所以我想要做的是在屏幕頂部使用gridview,在屏幕下半部使用table view。我認爲這很容易,但顯然我錯了。是的,我做了我平時搜索1小時,然後張貼在stackoverflow上的東西。在Android中添加兩個視圖
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1">
<GridView
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:numColumns="4"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"
android:layout_height="130dp"/>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1">
<TableRow>
<TextView
android:text="Name:"
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<EditText
android:hint="Name"
android:id="@+id/projectName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</TableRow>
<TableRow>
<TextView
android:text="Start"
android:id="@+id/startText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:text="Push"
android:id="@+id/startdate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:onClick="startDate"/>
</TableRow>
<TableRow>
<TextView
android:text="Finish"
android:id="@+id/finishText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/finishdate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:onClick="finishDate"/>
</TableRow>
</TableLayout>
</LinearLayout>
也許這很容易。也許我應該在早上上牀睡覺。 感謝您的幫助。
它現在的樣子。你有什麼問題? – Rasel