私は、上下LinearLayoutに3つButtonsの垂直方向に整列した垂直を持っています。各ボタンの間にLinearLayout、可視性がGONE最初にある を設定しました。最初のボタンをクリックすると、LinearLayoutその下に変更VISIBLEされ、そのレイアウトで定義したリスト ビューが表示され、残りの 2 つButtonsは にアタッチされたままになりLinearLayoutます。
LinearLayout問題は、 t内のリスト ビュー(Java コードを使用して追加したもの) が大きすぎる場合Buttons、1 つ目の下の 2 つが表示されなくなることです。残っているのは、1 番目のボタンの下のレイアウトです。
Buttons2をビューにバインドしたい。どんな助けでも大歓迎です。ありがとう。
これが私のレイアウトです:
LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="350dp"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="@+id/buttonContact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Contacts"
android:background="@drawable/button_style"
android:textColor="#E6E6E6"/>
<LinearLayout
android:id="@+id/layoutContact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
</LinearLayout>
<Button
android:id="@+id/buttonLog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Call Logs"
android:background="@drawable/button_style" />
<LinearLayout
android:id="@+id/layoutLog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >
</LinearLayout>
<Button
android:id="@+id/buttonVm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Voicemail"
android:background="@drawable/button_style"/>
<LinearLayout
android:id="@+id/layoutVm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
</LinearLayout>
</LinearLayout>