0

通常のレイアウトとしてバックグラウンドに添付されているようなレイアウトを作成するにはどうすればよいですか。そのレイアウトから、いずれかをクリックするか、そのレイアウトに戻ると、オーバーレイレイアウトにはフォームフィールドボタンまたはテキストが付属する必要があります...任意

前もって感謝します。

ここに画像の説明を入力

4

3 に答える 3

4

RelativeLayout または FrameLayout を使用します。最後の子ビューは、他のすべてをオーバーレイします。

オーバーレイ ビューが一番上にあることを確認するViewGroup.bringChildViewToFront()には、相対レイアウトを呼び出すことができます。

例:

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/root_view">

    <EditText
        android:layout_width="fill_parent"
        android:id="@+id/editText1"
        android:layout_height="fill_parent">
    </EditText>

    <EditText
        android:layout_width="fill_parent"
        android:id="@+id/editText2"
        android:layout_height="fill_parent">
        <requestFocus></requestFocus>
    </EditText>

</FrameLayout>

このレイアウトでは、editText2 が editText1 をカバーします。

于 2013-03-15T11:23:59.090 に答える
1

を使用する必要があると思いますFrameLayout。オブジェクトを前後に追加できます。ドキュメントでそれについて読んでください。

于 2013-03-15T11:23:38.477 に答える