次のビュー ウィジェットを使用してビューを整理しようとしています -
- TextView (画面の幅を埋める必要があり、特定の高さがあります)
- Draw() を使用して描画されたカスタム ビュー (幅を埋め、上記のテキストビューの後に開始し、画面を埋めます)
ボード ゲームを作成しようとしているため、カスタム ビューが描画されます。
私の問題は、これに使用するのに最適なレイアウトは何ですか?
TableLayout を使用して、これら 2 つのビューをそれぞれ 1 つの列にすることはできますか? これでうまくいくと思いましたが、カスタムビューに使用するレイアウトは、描画しているテーブル行が画面を埋め尽くしても、画面を埋めません。
私は自分自身を適切に説明できたことを願っています。どんなポインタでも大歓迎です。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tl_question"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:shrinkColumns="1"
android:stretchColumns="2">
<TableRow>
<TextView
android:id="@+id/question"
android:layout_width="wrap_content"
android:textSize="30sp"
android:textColor="#ffFFFFFF"
android:layout_gravity="center_vertical"
android:paddingBottom="9dip"
android:layout_marginLeft="3dip"
android:layout_marginRight="2dip"/>
</TableRow>
<TableRow>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_vertical" >
<com.ac.gui.CustomView
android:id="@+id/custom_board"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:keepScreenOn="true" />
</LinearLayout>
</TableRow>
</TableLayout>
</RelativeLayout>