Toolbar 在5.0上和状态栏重叠

移动开发 码拜 8年前 (2016-05-24) 1076次浏览
在5.0以下不会。
Toolbar 在5.0上和状态栏重叠
这个是布局文件代码:

<?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:background="@color/bg_under"
    android:fitsSystemWindows="true"
    tools:context=".activity.MainActivity">
    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true">
        <android.support.v7.widget.Toolbar
            android:id="@+id/tool_bar_main"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:layout_gravity="bottom"
            android:minHeight="?attr/actionBarSize"
            app:popupTheme="@style/AppTheme.PopupOverlay"
            app:theme="@style/AppTheme.AppBarOverlay" />
    </android.support.design.widget.AppBarLayout>
解决方案

10

http://www.zhihu.com/question/31468556

10

android:fitsSystemWindows=”true”

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Toolbar 在5.0上和状态栏重叠
喜欢 (0)
[1034331897@qq.com]
分享 (0)