2017-08-25 26 views
0

我爲我的應用程序使用海關主題,但是當我選擇不同的主題我的工具欄重疊狀態欄。我無法弄清楚問題所在。 建議將不勝感激。工具欄重疊,當我嘗試應用主題

Screenshot

我的活動
<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:context=".Activities.MainActivity"> 

    <android.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:fitsSystemWindows="false" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      app.popupTheme="@style/AppTheme.PopupOverlay"> 

      <io.gloxey.cfv.CFTextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="@string/app_name" 
       android:layout_gravity="center" 
       app:font_name="@string/sintony" 
       android:textColor="@android:color/white" 
       android:textSize="20sp" 
       android:textStyle="bold" 
       android:id="@+id/toolbar_title" /> 

      </android.support.v7.widget.Toolbar> 

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

    <include layout="@layout/placeholder_dialog" /> 
    <include layout="@layout/content_main" /> 

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

主題。我試圖設置android:fitsSystemWindow:false,但它不起作用。

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

    <style name="AppTheme.NoActionBar"> 
     <item name="windowActionBar">false</item> 
     <item name="windowNoTitle">true</item> 
    </style> 

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> 
    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> 
+0

你能分享你當前活動的主題嗎? –

+0

看到主題@AbdulKawee –

回答

0

我想通了: -

<android.support.design.widget.CoordinatorLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="false" 
    tools:context=".Activities.MainActivity"> 

這個問題在協調佈局。我設置了android:fitsSystemWindows =「false」。而已!