0
2列我有TableLayout一个问题,因为我想存储在2列2行所示的ImageView和TextView的,但我的网页 我的样本代码:存储元素与TableLayout
<?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">
<TableRow
android:layout_height="100dp"
android:layout_width="wrap_content">
<TextView
android:id="@+id/tv_country"
android:textStyle="bold"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12dp"
android:paddingRight="5dp"/>
</TableRow>
<TableRow
android:layout_height="100dp"
android:layout_width="wrap_content">
<ImageView
android:id="@+id/iv_flag"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:paddingLeft="5dp"/>
<TextView
android:id="@+id/tv_country_details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12dp"
android:paddingRight="5dp"/>
</TableRow>
</TableLayout>
我试过了,它显示在2行!我使用这个页面作为ListView – user3404171 2014-10-16 13:20:04
我的XML代码是正确的,你可能在listview中有两个项目!或者你的java代码有问题。 – khurram 2014-10-16 13:21:20
是的,xml是好的, – user3404171 2014-10-16 13:29:14