是否可以在相对布局中使用表格布局。例如:相对布局中的表格布局
main.xml中:
< RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow
android:id="@+id/tableRow4"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="center_horizontal" >
<TextView
android:id="@+id/textView9"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18dp"
android:text="Weather Table"
android:gravity="center"> < /TextView>
</ TableRow>
</ TableLayout>
</ RelativeLayout>
如何使用在单个XML文件中的两个类型的布局。
您分配给TableLayout( “http://schemas.android.com/apk/res/android”)
上述代码有什么问题?您可以在Android中使用嵌套布局。 – Egor