I noticed what looks like a bug with the TableLayout. As far
as I can see it only happens when using references to string
values (so it needs to be set via the strings.xml rather than hard coded a value).
I've not completely nailed the symptoms but I've observed the following behaviour:
#1. When setting the last referenced string value of the first row to
have a bold style then the value is repeated on to the first cell of
the next row and the bold style is not applied to the cell.
#2. In conjunction with #1 but also setting another value in that row
from a reference and setting it to have a bold style then then that
value plus the last in the row are emboldened.
#3. In conjunction with #1, set the last rows button text by a
referenced string value in the string.xml then the last cell value of
the previous row is repeated as the text in the button.
Has anyone else saw this?
Here is an example:
-----------------
table.xml
-----------------
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
- <TableLayout
- id="@+id/table_wrapper"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="#FFCC66">
- <TableRow android:background="#99FFFF" >
- <TextView android:text="N" android:background="#00FF00" />
- <TextView android:text="N" />
- <TextView android:text="N" />
- <TextView android:text="N" />
- <TextView android:text="N" />
- <TextView android:text="N" />
- <TextView android:text="@string/table_col_head6" />
- </TableRow>
- <TableRow android:background="#006666" >
- <TextView id="@+id/cal_00"
- android:text="@string/cell_00"
- android:textAlign="center" />
- <TextView id="@+id/cal_01"
- android:text="0"
- android:textAlign="center"
- android:background="#FFFF0000" />
- <TextView id="@+id/cal_02"
- android:text="0"
- android:textAlign="center" />
- <TextView id="@+id/cal_03"
- android:text="0"
- android:textAlign="center" />
- <TextView id="@+id/cal_04"
- android:text="0"
- android:textAlign="center" />
- <TextView id="@+id/cal_05"
- android:text="0"
- android:textAlign="center" />
- <TextView id="@+id/cal_06"
- android:text="0"
- android:textAlign="center" />
- </TableRow>
- <TableRow>
- <TextView id="@+id/cal_10"
- android:text="0"
- android:textAlign="center"/>
- <TextView id="@+id/cal_11"
- android:text="0"
- android:textAlign="center"/>
- <TextView id="@+id/cal_12"
- android:text="0"
- android:textAlign="center"/>
- <TextView id="@+id/cal_13"
- android:text="0"
- android:textAlign="center"/>
- <TextView id="@+id/cal_14"
- android:text="0"
- android:textAlign="center"/>
- <TextView id="@+id/cal_15"
- android:text="0"
- android:textAlign="center"/>
- <TextView id="@+id/cal_16"
- android:text="0"
- android:textAlign="center"/>
- </TableRow>
- <TableRow>
- <Button
- id="@+id/table_select"
- android:text="@string/table_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
- </TableRow>
- </TableLayout>
- </LinearLayout>
Parsed in 0.005 seconds, using GeSHi 1.0.8.4
-----------------
strings.xml
------------------