0

ここに画像の説明を入力

白いボックスの下にボタンを配置しようとしています。Java ファイルでは、id:ViewLayout に特別なビューを追加しています。フレームレイアウトの後にボタンを配置しようとしましたが、画面に表示されません....

<TextView
    android:id="@+id/tvClock"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:text="12:00"
    android:textColor="@android:color/white"
    android:textSize="100dp" />

<FrameLayout
    android:id="@+id/Container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <RelativeLayout
        android:id="@+id/ViewLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
    </RelativeLayout>

    <Button
        android:id="@+id/bUnlock"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Unlock" />

    <Button
        android:id="@+id/bPin"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="PIN" />
</FrameLayout>

ありがとう!

4

3 に答える 3

0
<TextView
android:id="@+id/tvClock"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="12:00"
android:textColor="@android:color/white"
android:textSize="100dp" />

<RelativeLayout
android:id="@+id/Container"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<RelativeLayout
    android:id="@+id/ViewLayout"
    android:layout_width="match_parent"
    android:layout_height="100dp" >
</RelativeLayout>

<Button
    android:id="@+id/bUnlock"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Unlock" 
    android:layout_below="@id/ViewLayout"
 />

<Button
    android:id="@+id/bPin"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="PIN" 
    android:layout_below="@id/bUnlock"/>
</RelativeLayout>

RelativeLayoutの代わりに試してくださいframelayout

于 2013-11-11T01:01:36.133 に答える