Android status bar scrolling up with coordinator layout, leaving status icons overlapping toolbar title

后端 未结 1 948
予麋鹿
予麋鹿 2020-12-25 14:35

I am experiencing an issue when using Coordinator Layout that contains an AppBarLayout (holding a ToolBar and a TabLayout) and a ViewPager (holding fragments) as children. I

相关标签:
1条回答
  • 2020-12-25 15:16

    Review the theme for the activity, if the theme is like @style/AppTheme.NoActionBar or one theme without ActionBar, try putting a color, you must have a style(v21) something like this:

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>    
    </style>
    

    change it for :

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@color/colorPrimaryDark</item>
    </style>
    
    0 讨论(0)
提交回复
热议问题