2017-08-16 8 views
1

マスターディテールレイアウト内にツールバーを挿入した後、何らかの理由でマスターディテール列とディテール列が消えました。これを解決するために何が必要なのでしょうか?レイアウトにツールバーを含めた後にマスターディテール列が消えます

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="horizontal" 
    android:divider="@drawable/divider_vertical" 
    android:showDividers="middle" 
    android:baselineAligned="false"> 

    <include layout="@layout/myToolbar"/> 

    <RelativeLayout 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:id="@+id/master_container"/> 

    <FrameLayout 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="3" 
     android:id="@+id/detail_container"/> 

</LinearLayout> 

enter image description here

答えて

1

これを試してみてください:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <include layout="@layout/myToolbar"/> 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:baselineAligned="false" 
     android:divider="@drawable/divider_vertical" 
     android:orientation="horizontal" 
     android:showDividers="middle"> 

     <RelativeLayout 
      android:id="@+id/master_container" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_weight="1"/> 

     <FrameLayout 
      android:id="@+id/detail_container" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_weight="3"/> 

    </LinearLayout> 

</LinearLayout> 
+0

パーフェクト!どうもありがとう :-) – MacaronLover

関連する問題