开发者

TableLayout formatting loss after device rotation

I'm seeing a strange issue with a TableLayout after the device is rotated from either orientation. If you load the view in either portrait or landscape mode, the table loads fine. But once you rotate the device, the columns collapse to just fit their width. I would expect that after开发者_如何转开发 rotation, the columns would still stretch to fit the width of the screen. Any ideas on what can be done to resolve this? Screenies and layout code below.

Before Rotation:

before rotation http://dl.dropbox.com/u/334957/normal_from_portrait.png

After Rotation:

after rotation http://dl.dropbox.com/u/334957/after_rotate_portrait.png

Table Layout:

    <TableLayout android:id="@+id/dataTable"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_weight="1"
    android:layout_below="@id/chart"
 android:stretchColumns="*"
    android:shrinkColumns="*"
    android:padding="6dip"
 >  
 </TableLayout>

Table Row:

    <TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
    android:layout_height="fill_parent">
          <TextView android:id="@+id/col1"
          android:layout_marginRight="2dip"
          android:textColorLink="#FF21759b"
          android:text="Column 1"
          android:padding="4dip"
          android:textColor="#FF464646"/>
          <TextView android:id="@+id/col2" android:text="Column 2"
          android:textColor="#FF464646"
          android:padding="4dip"/>
</TableRow> 

Thanks!


I think it is the same as here Buttons in TableLayout cropped on Android 1.6 and 2.1 (but not on 1.5 or 2.2)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜