TableLayout cell values being repeated across rows

Put your problem here if it does not fit any of the other categories.

TableLayout cell values being repeated across rows

Postby gsheep » Sun Jan 27, 2008 3:42 pm

Hello maybe someone can confirm or disprove my bug.
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
-----------------

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.    android:orientation="vertical"
  6.  
  7.    android:layout_width="fill_parent"
  8.  
  9.    android:layout_height="wrap_content">
  10.  
  11.  
  12.  
  13.         <TableLayout
  14.  
  15.                id="@+id/table_wrapper"
  16.  
  17.                android:layout_width="fill_parent"
  18.  
  19.                android:layout_height="fill_parent"
  20.  
  21.                android:background="#FFCC66">
  22.  
  23.  
  24.  
  25.                             <TableRow android:background="#99FFFF" >
  26.  
  27.                                 <TextView android:text="N" android:background="#00FF00" />
  28.  
  29.                                 <TextView android:text="N" />
  30.  
  31.                                 <TextView android:text="N" />
  32.  
  33.                                 <TextView android:text="N" />
  34.  
  35.                                 <TextView android:text="N" />
  36.  
  37.                                 <TextView android:text="N" />
  38.  
  39.                                 <TextView android:text="@string/table_col_head6" />
  40.  
  41.                             </TableRow>
  42.  
  43.  
  44.  
  45.                             <TableRow  android:background="#006666" >
  46.  
  47.                                 <TextView id="@+id/cal_00"
  48.  
  49. android:text="@string/cell_00"
  50.  
  51. android:textAlign="center" />
  52.  
  53.                                 <TextView id="@+id/cal_01"
  54.  
  55. android:text="0"
  56.  
  57. android:textAlign="center"
  58.  
  59. android:background="#FFFF0000" />
  60.  
  61.                                 <TextView id="@+id/cal_02"
  62.  
  63. android:text="0"
  64.  
  65. android:textAlign="center" />
  66.  
  67.                                 <TextView id="@+id/cal_03"
  68.  
  69. android:text="0"
  70.  
  71. android:textAlign="center" />
  72.  
  73.                                 <TextView id="@+id/cal_04"
  74.  
  75. android:text="0"
  76.  
  77. android:textAlign="center" />
  78.  
  79.                                 <TextView id="@+id/cal_05"
  80.  
  81. android:text="0"
  82.  
  83. android:textAlign="center" />
  84.  
  85.                                 <TextView id="@+id/cal_06"
  86.  
  87. android:text="0"
  88.  
  89. android:textAlign="center" />
  90.  
  91.                             </TableRow>
  92.  
  93.  
  94.  
  95.                             <TableRow>
  96.  
  97.                                 <TextView id="@+id/cal_10"
  98.  
  99. android:text="0"
  100.  
  101. android:textAlign="center"/>
  102.  
  103.                                 <TextView id="@+id/cal_11"
  104.  
  105. android:text="0"
  106.  
  107. android:textAlign="center"/>
  108.  
  109.                                 <TextView id="@+id/cal_12"
  110.  
  111. android:text="0"
  112.  
  113. android:textAlign="center"/>
  114.  
  115.                                 <TextView id="@+id/cal_13"
  116.  
  117. android:text="0"
  118.  
  119. android:textAlign="center"/>
  120.  
  121.                                 <TextView id="@+id/cal_14"
  122.  
  123. android:text="0"
  124.  
  125. android:textAlign="center"/>
  126.  
  127.                                 <TextView id="@+id/cal_15"
  128.  
  129. android:text="0"
  130.  
  131. android:textAlign="center"/>
  132.  
  133.                                 <TextView id="@+id/cal_16"
  134.  
  135. android:text="0"
  136.  
  137. android:textAlign="center"/>
  138.  
  139.                             </TableRow>
  140.  
  141.  
  142.  
  143.                         <TableRow>
  144.  
  145.                         <Button
  146.  
  147.                                id="@+id/table_select"
  148.  
  149.                                android:text="@string/table_button"
  150.  
  151.                                android:layout_width="wrap_content"
  152.  
  153.                                android:layout_height="wrap_content"/>
  154.  
  155.  
  156.  
  157.                         </TableRow>
  158.  
  159.  
  160.  
  161.         </TableLayout>
  162.  
  163.  
  164.  
  165. </LinearLayout>
  166.  
  167.  
Parsed in 0.011 seconds, using GeSHi 1.0.8.4

-----------------
strings.xml
------------------

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.         <string name="table_col_head6"><b>S</b></string>
  2.  
  3.         <string name="cell_00">0</string>
  4.  
  5.         <string name="table_select">Select Jog</string>
  6.  
  7.         <string name="table_button">Select Button</string>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
gsheep
Freshman
Freshman
 
Posts: 5
Joined: Sun Dec 23, 2007 2:58 pm

Top

Postby gsheep » Tue Jan 29, 2008 9:20 pm

Sorry to bump the thread! But has anyone dissproven this bug?
gsheep
Freshman
Freshman
 
Posts: 5
Joined: Sun Dec 23, 2007 2:58 pm

Postby plusminus » Wed Jan 30, 2008 12:50 am

Hello gsheep,

I cannot see a "bold" anywhere in your xml-layout :?

This is my output if it helps you further:
Image


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests