1、沉浸式标题栏,中心思想就是,自定义的状态栏打通原始系统的,并且增加一个标题栏,如图所示。
2、以上效果分为2部分,第一部分就是和状态栏完全同尺寸的自定义状态栏,第二部分就是和自定义背景颜色一样的标题栏。
3、具体代码如下。
<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:gravity="center_horizontal"
android:orientation="vertical"
tools:context="com.uuch.android_zxinglibrary.LoginActivity">
<LinearLayout
android:id="@+id/phone_title_status"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/phone_home_title_backgroud_color"
android:orientation="vertical" >
</LinearLayout>
<com.uuch.android_zxinglibrary.customwidgets.TitleBarPublic
android:id="@+id/phone_title_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clipChildren