2017-02-08 9 views
0

が重なり、そのレイアウトのコードは次のとおりです。ツールバーは、私はツールバーを持っている活動では半透明のステータスバー

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    tools:context="com.aminiam.moviekade.fragment.AllReviewFragment"> 

    <android.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:fitsSystemWindows="true" 
     android:theme="@style/AppTheme"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> 

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

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/recReview" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_below="@+id/toolbar"/> 

</LinearLayout> 

が、私は私のアプリで透明ステータスバーを持つようにしたいと私は活動のテーマ、ツールバーに<item name="android:windowTranslucentStatus">true</item>を追加するときステータスバーに重なることになります。

値-V21のstyle.xml:

<resources> 
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> 
    <!-- Customize your theme here. --> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorAccent">@color/colorAccent</item> 
    <item name="android:windowBackground">@color/windowBackground</item> 
</style> 

<style name="TransparentStatusBar" parent="AppTheme"> 
    <item name="android:windowTranslucentStatus">true</item> 
</style> 

私はstackoverflowの中にすべての答えをテストしたが、彼らは問題を解決することができませんでした。

enter image description here

+0

AppBarLayoutのテーマは 'app:theme =" @ style/AppTheme.AppBarOverlay "'にし、これをスタイル '