laobie / StatusBarUtil

A util for setting status bar style on Android App.
http://t.cn/Rq746Kb
Apache License 2.0
8.82k stars 1.72k forks source link

奇怪的问题 #11

Closed wznshuai closed 8 years ago

wznshuai commented 8 years ago

demo 中 ImageStatusBarActivity,现有的XML外面在包一层任意的根节点(ps:LinearLayout、RelativeLayout),在N5手机(6.0)上状态栏看起来就不是透明的,因为猴子图片没有顶上去,除非新加的根节点设置这张猴子图片。 那么我想问的是 是什么造成原有的图片没有match_parent呢 明明是这么设置的。。

<?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="@color/colorAccent" android:orientation="vertical">

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg_monkey">

    <Button
        android:id="@+id/btn_change_background"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_gravity="bottom|center_horizontal"
        android:layout_margin="16dp"
        android:text="Change Background" />

    <SeekBar
        android:id="@+id/sb_change_alpha"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/btn_change_background"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp" />

    <TextView
        android:id="@+id/tv_status_alpha"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@id/sb_change_alpha"
        android:layout_centerHorizontal="true"
        android:layout_gravity="center_horizontal"
        android:textColor="@color/colorAccent"
        android:textSize="36sp" />
</RelativeLayout>

</LinearLayout>

laobie commented 8 years ago

@wznshuai 抱歉一直没回复,这个issue暂时开着,后面我考虑通过重写一个fitSystemWindows来看看这个问题,解决了会通知你 : )

wznshuai commented 8 years ago

@laobie HI 你好 我fork了你的项目,并且5.0以上沉浸模式和着色模式修改了实现方式,解决了之前所有的问题,有时间可以看一下是否还有什么问题 https://github.com/wznshuai/StatusBarUtil

laobie commented 8 years ago

@wznshuai 你可以提pr过来的