android沉浸式状态栏

来源:互联网 发布:深入浅出 python 中文 编辑:程序博客网 时间:2024/04/30 10:05

1、java代码,在setContentView方法前调用:

 SystemBarTintManager.initSystemBar(this);

SystemBarTintManager类的下载地址:点我下载

2、布局文件中:

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:background="#eee"    android:orientation="vertical">    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:background="#0056ac"        android:clipToPadding="true"        android:fitsSystemWindows="true">        ...标题栏写在这    </RelativeLayout>    ...其他内容 </LinearLayout>......

其他:RecyclerView的下拉刷新上拉加载

0 0