私は2を使用することにしました RelativeLayouts
私のアプリの場合、 Layout
子供の一部 Views
左の画面で、もう一方は子供用 Views
右側に移動します。
問題は、XMLでそれらをレイアウトする方法がわからないので、 Layout
.
1を使用する場合 RelativeLayout
、中央の空白は RelativeLayout
、そしてその背後にあるものに触れることができません。
読んでくれてありがとう。
回答:
回答№1は2次の例のような何かをします。
これにより、 LinearLayout
2 RelativeLayouts
を使用して layout_weight
間隔をあける RelativeLayouts
そして、あなたは RelativeLayouts
あなたが望むものは何でも。
ザ Buttons
例のための単なるプレースホルダーです。
<?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:orientation="horizontal" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST1" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST2" />
</RelativeLayout>
</LinearLayout>