0
このようなレイアウト(横向きモード): - 上の4つの均等に配置されたボタン - EditTextブロックとその右隣のImageButton - 下部はテキストビューです。ここでAndroidレイアウト:LinearLayoutとTableLaoutを組み合わせる
は、私は、このレイアウトを実装するために使用されるXMLファイルです。しかし
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:padding="20dip"
>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="*">
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/b1"
android:drawablePadding="5sp"
android:text="B1"></Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/b2"
android:drawablePadding="5sp"
android:text="B2"></Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/b3"
android:drawablePadding="7sp"
android:text="B3"></Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/b4"
android:drawablePadding="7sp"
android:text="B4"></Button>
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="*">
<TableRow>
<EditText
android:id="@+id/entry"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_below="@id/e1"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
/>
<ImageButton
android:id="@+id/search2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/i1"
android:layout_marginTop="10dp"
/>
</TableRow>
<TextView
android:id="@+id/t2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="T2"/>
</TableLayout>
</LinearLayout>
、私は私が望むように、残り(第2行目と3行目)がある上に、4つのボタンで言いますページには表示されません(見えません)。彼らがどこに行ったのか分かりません。 私はこれについて助けていただきありがとうございます。 おかげで、
TJ
ありがとうございました。問題でした。ご協力いただきありがとうございます。 – TJ1
... LinearLayoutのデフォルトの向きが水平であるためです。 –