1

私はアンドロイドが初めてです。跳ねるボールゲームに次のレイアウト(下の画像を参照)が必要です。使用するレイアウトを教えてください。


ここに画像の説明を入力

4

2 に答える 2

1

Vertical linearLayout を 2 つに分割して使用します。

このようなもの:

<?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:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:orientation="vertical" >
        <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:text="PlayingArea" />
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="16dp"
            android:paddingRight="16dp"
            android:orientation="horizontal" >
                <Button
                    android:layout_width="100dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="right"
                    android:text="left_lower_box" />
                <Button
                    android:layout_width="100dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="right"
                    android:text="right_lower_box" />
            </LinearLayout>
</LinearLayout>

これは単なるサンプルです。おそらくアプリでボタンを使用することはなく、高さと幅を設定する必要があります。

于 2012-09-30T05:36:51.520 に答える
1

ボールがバウンドする部分とスコアレイアウトを設計する部分の 2 つの部分に分割された垂直方向の LinearLayout を使用することをお勧めします。スコアのレイアウトは、向きが水平の linearLayout で再び設計できます。

于 2012-09-30T05:39:27.900 に答える