私は3行に9つのボタンがあり、FrameLayout
も必要です。その目的は、ユーザーがメニューオプションをクリックして何かを選択したときにボタンを削除し、FrameLayout
を開くことです。 ボタンでレイアウトにframelayoutを配置するにはどうすればいいですか?
そして、これのようなとき、私それがどのように見えるかです:私はこれは私がFrameLayout
を入れしようとすると何が起こるかであるFrameLayout
を置くしようとすると、奇妙なことが起こると私は何のために助けを必要とすることは、このレイアウトのXMLですそれを持っていない:ここでは
は、レイアウトのための私のXMLです:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#32c6a6"
android:weightSum="3">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3">
<LinearLayout
android:orientation="horizontal"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/linRow1"
android:layout_weight="1"
android:weightSum="3">
<Button
android:text="13 egenskaber"
android:id="@+id/G_Egenskaber"
android:textSize="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/redbotton"
android:layout_weight="1"
android:textColor="#ffffff"/>
<Button
android:text="Profeternes egenskaber"
android:id="@+id/P_egenskaber"
android:textSize="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/redbotton"
android:layout_weight="1"
android:textColor="#ffffff"/>
<Button
android:text="Bøntider"
android:id="@+id/Boentider"
android:textSize="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/redbotton"
android:layout_weight="1"
android:textColor="#ffffff"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/linRow2"
android:layout_weight="1"
android:weightSum="3">
<Button
style="?android:attr/buttonStyleSmall"
android:text="Wudu"
android:id="@+id/Wudu"
android:textSize="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bluebotton"
android:layout_weight="1"
android:textColor="#ffffff"/>
<Button
android:text="Wudu's betingelser"
android:id="@+id/Wudu_B"
android:textSize="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bluebotton"
android:layout_weight="1"
android:textColor="#ffffff"/>
<Button
style="?android:attr/buttonStyleSmall"
android:text="Wudu's afbrydelser"
android:id="@+id/Wudu_A"
android:textSize="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bluebotton"
android:layout_weight="1"
android:textColor="#ffffff"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/linRow3"
android:layout_weight="1"
android:weightSum="3">
<Button
android:text="Bønnens søjler"
android:id="@+id/Boen_S"
android:textSize="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/yellowbotton"
android:layout_weight="1"
android:textColor="#ffffff"/>
<Button
android:text="Bønnens betingelser"
android:id="@+id/Boen_B"
android:textSize="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/yellowbotton"
android:layout_weight="1"
android:textColor="#ffffff"/>
<Button
android:text="Bønnens afbrydelser"
android:id="@+id/Boen_A"
android:textSize="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/yellowbotton"
android:layout_weight="1"
android:textColor="#ffffff"/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
ボタンで2つのレイアウト - xmlを作成し、フレームレイアウトで1つを作成し、インフレータでロードすることができます – Flo