0

を示していない。AndroidのメーカーDrawerLayout scrimcolor私は、次のレイアウトを使用する活性を有する

<android.support.v4.widget.DrawerLayout 
android:id="@+id/root_main_activity" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
tools:openDrawer="start" 
xmlns:tools="http://schemas.android.com/tools"> 

<android.support.design.widget.AppBarLayout 
    android:id="@+id/appbarlayout_main_activity" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar_main_activity" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/colorPrimary"/> 

    <android.support.design.widget.TabLayout 
     android:id="@+id/tablayout_main_activity" 
     app:tabIndicatorHeight="3dp" 
     app:tabIndicatorColor="@android:color/white" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

    <android.support.v4.view.ViewPager 
     android:id="@+id/viewpager_main_activity" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/colorWindowBackground" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 

</android.support.design.widget.AppBarLayout> 

<android.support.design.widget.NavigationView 
    android:id="@+id/navigationview" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:background="@color/colorWindowBackground" 
    android:fitsSystemWindows="true" 
    android:layout_gravity="start"> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fillViewport="true"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

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

      <ExpandableListView 
       android:id="@+id/expandablelistview_drawer" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:groupIndicator="@null" 
       android:divider="@null" 
       android:dividerHeight="0dp"/> 

     </LinearLayout> 

    </ScrollView> 

</android.support.design.widget.NavigationView> 

私は私のような、と考えることができることをすべてを試してみました。ナビゲーションビューをappbarlayout内の別の場所に配置し、appbarlayoutの前と後に配置し、最後にアクティビティのoncreateメソッドでスクリムカラーを動的に設定しようとします。これらの事のどれも働かなかった、誰かが私の問題の解決策を知っていますか?

答えて

0

多くの試した後、私はそれを働かせました。

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v4.widget.DrawerLayout 
    android:id="@+id/root_main_activity" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    tools:openDrawer="start" 
    xmlns:tools="http://schemas.android.com/tools"> 

<LinearLayout 
    android:id="@+id/linearlayout_main_activity" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <android.support.design.widget.AppBarLayout 
     android:id="@+id/appbarlayout_main_activity" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar_main_activity" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary"/> 

     <android.support.design.widget.TabLayout 
      android:id="@+id/tablayout_main_activity" 
      app:tabIndicatorHeight="3dp" 
      app:tabIndicatorColor="@android:color/white" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"/> 

    </android.support.design.widget.AppBarLayout> 

    <android.support.v4.view.ViewPager 
     android:id="@+id/viewpager_main_activity" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/colorWindowBackground" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 

</LinearLayout> 

<android.support.design.widget.NavigationView 
    android:id="@+id/navigationview" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:background="@color/colorWindowBackground" 
    android:fitsSystemWindows="true" 
    android:layout_gravity="start"> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fillViewport="true"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

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

      <ExpandableListView 
       android:id="@+id/expandablelistview_drawer" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:groupIndicator="@null" 
       android:divider="@null" 
       android:dividerHeight="0dp"/> 

     </LinearLayout> 

    </ScrollView> 

</android.support.design.widget.NavigationView> 

:私には明確ではないが、ここで同じ問題を抱えている人々のために働いたレイアウトである理由
関連する問題