2

私はMono Droidで遊んでいて、次のレイアウトを実装しようとしています

ここに画像の説明を入力

どのタイプのレイアウトを使用しますか? Android には、WinForms のようなアンカーやドッキングのようなものがあるので、ある程度独立させることができますか?

これはタブレット専用で、私の実験用です。左パネル内のボタンは繰り返します。

ありがとう。

4

2 に答える 2

1

ルート レイアウトは次のようになります。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:baselineAligned="false"
    android:orientation="horizontal"
    android:padding="5dp" >

    <RelativeLayout
        android:id="@+id/leftContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="0.8" >
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/rightContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1" >

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:padding="20dp" >

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:text="btn1" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:text="btn2" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:text="btn3" />
        </RelativeLayout>
    </RelativeLayout>

</LinearLayout>

Right and Left Layoutsの上部にListViewとして動的アイテムを追加します。

于 2012-10-24T10:04:41.193 に答える
0

線形レイアウトは適切に機能します..キャプチャするスペースを指定するための重みを与えることができます..

于 2012-10-24T10:05:03.063 に答える