tablelayout

Android dynamically created table - bad performance

笑着哭i 提交于 2019-12-09 20:58:37
问题 i would like you to help me. I want to create dynamicly table (screenshot). I created it via code below: TableLayout tl = (TableLayout) findViewById(R.id.main_table); FOR. 1-300......... TableRow tr_head = new TableRow(this); tr_head.setId(10); tr_head.setBackgroundColor(Color.CYAN); tr_head.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT)); RelativeLayout rl = new RelativeLayout(this); rl.setId(20); ImageButton xyz = new ImageButton(this); xyz.setId(21);

CSS table layout with missing cells

柔情痞子 提交于 2019-12-08 12:17:13
问题 I have HTML content from an external source to work with. It is tagged with divs and look somewhat like this: <!DOCTYPE html> <html> <head> <title>Example</title> <link rel="stylesheet" href="mycss.css" type="text/css"/> </head> <body> <div class="book"> <div class="author">Author 1</div> <div class="title">Title 1</div> <div class="publisher">Publisher</div> <div class="year">2012</div> </div> <div class="book"> <div class="author">Author 2</div> <div class="title">Title 2</div> <div class=

Android : Dynamic TableLayout

白昼怎懂夜的黑 提交于 2019-12-08 05:54:10
问题 My goal is to get data from DB, and then display it as a table in my app. Here is my code: public void updateLastExpenses(){ Cursor c = Expense.getAll(this); TableLayout lastExpensesTable = (TableLayout)findViewById(R.id.lastExpensesTable); lastExpensesTable.setStretchAllColumns(true); while (c.moveToNext()) { String name = c.getString( c.getColumnIndexOrThrow(ExpenseContract.ExpenseEntry.COLUMN_NAME_NAME) ); float amount = c.getFloat( c.getColumnIndexOrThrow(ExpenseContract.ExpenseEntry

Android TableLayout with over 1000 rows loading very slowly

核能气质少年 提交于 2019-12-07 23:10:14
问题 I'm looking for a way to speed up the creation of a TableLayout with over 1000 rows. Is there a way to create a TableLayout entirely on a separate thread or a way to speed it up? Here is my method that is creating the table: private void setTable() { final Activity activity = this; final Handler handler = new Handler(); new Thread(new Runnable() { @Override public void run() { for (int x = 0; x < rooms.size(); x++) { final int inx = x; handler.post(new Runnable() { @Override public void run()

How to create a full screen TableLayout programmatically (table height collapses unintendedly)

亡梦爱人 提交于 2019-12-07 17:31:24
问题 The following TableLayout matches exactly my requirements (it fills its parent and columns are stretched evenly): <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#7434a6" > <TableRow android:layout_width="fill_parent" android:layout_height="0px" android:layout_weight="1" > <TextView android:layout_width="fill_parent" android:layout_height=

Android : Dynamic TableLayout

女生的网名这么多〃 提交于 2019-12-07 13:30:27
My goal is to get data from DB, and then display it as a table in my app. Here is my code: public void updateLastExpenses(){ Cursor c = Expense.getAll(this); TableLayout lastExpensesTable = (TableLayout)findViewById(R.id.lastExpensesTable); lastExpensesTable.setStretchAllColumns(true); while (c.moveToNext()) { String name = c.getString( c.getColumnIndexOrThrow(ExpenseContract.ExpenseEntry.COLUMN_NAME_NAME) ); float amount = c.getFloat( c.getColumnIndexOrThrow(ExpenseContract.ExpenseEntry.COLUMN_NAME_AMOUNT) ); String date = c.getString( c.getColumnIndexOrThrow(ExpenseContract.ExpenseEntry

Most up-to-date version of the java “Clearthought” TableLayout project

一笑奈何 提交于 2019-12-07 12:16:28
问题 What is the status of the java "Clearthought" TableLayout project? is it still being maintained? what is its most up-to-date website? old page: http://www.clearthought.info/sun/products/jfc/tsc/articles/tablelayout/ not working: https://tablelayout.dev.java.net/ maven repository with 2005 version: http://mvnrepository.com/artifact/tablelayout/TableLayout/20050920 any other more up-to-date page? 回答1: It seems that the author abandoned the project. So I decided to bring it back to life: change

Dynamically added table rows not appearing

主宰稳场 提交于 2019-12-07 06:45:09
问题 I have seen many posts regarding dynamically adding table rows, but I am not sure what I'm missing. When I execute the following, nothing is displayed (aside from application title bar). My Layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/table_view_test_main" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" > <ScrollView android:id="@+id/tvt_scroll" android:layout_width="fill

How to programmatically set textview-s and their properties?

纵饮孤独 提交于 2019-12-07 06:24:26
问题 I'm programmatically populating a tablelayout in a scrollview with tablerow-s. In the tablerows I am putting the data in textviews. Now my questyon is how to programmatically(in java) set textviews like this: <TextView android:layout_width="20dp" android:layout_height="wrap_content" android:layout_marginLeft="10dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/tab" android:layout_weight="0.4" android:minWidth="80dp" /> <TextView android

table-layout: fixed issue with column widths

纵饮孤独 提交于 2019-12-07 03:26:58
问题 We're using the CSS table-layout: fixed property for our mobile app. (I don't recall the full reason, but I believe it had to do with enabling word wrapping of some sorts)... I've run into an issue where we need to size one of the two columns of the two column table. Not a big deal, usually we do this: <table> <tbody> <tr> <th width="20%">hello world</th> <td>hello world</td> </tr> </tbody> </table> That works fine. However, if we need to create a row that spans both columns BEFORE this one: