Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolbar被覆盖了statusbar的位置 #12

Closed
BelongsH opened this issue Apr 4, 2016 · 8 comments
Closed

toolbar被覆盖了statusbar的位置 #12

BelongsH opened this issue Apr 4, 2016 · 8 comments
Labels

Comments

@BelongsH
Copy link

BelongsH commented Apr 4, 2016

出现的问题:toolbar被覆盖了statusbar的位置,米3, Sys:6.1

xml:

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/dl_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="#ccffee" />


        <FrameLayout
            android:id="@+id/fl_main_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />


    </LinearLayout>

    <LinearLayout
        android:id="@+id/ll_main_menu_parent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="start">

        <FrameLayout
            android:id="@+id/fl_main_menu"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </LinearLayout>


</android.support.v4.widget.DrawerLayout>

java:
@OverRide
public void setStatusBar() {
StatusBarUtils.setTranslucentForDrawerLayout(this, dl_main, 0);
}

@laobie
Copy link
Owner

laobie commented Apr 6, 2016

等我这几天有空测试下,如果修复了这个bug我会通知你的 : )

@laobie laobie added the bug label Apr 8, 2016
@Aysnine
Copy link

Aysnine commented Apr 9, 2016

不知道是不是同样的问题,应该说是content没有给 StatusBar 腾出位置。

软件 StatusBarUtil.apk 正常,不知道是代码哪里的问题。

小魅蓝,FlymeOS 4.2.1.2C,Android 4.4.4

@laobie
Copy link
Owner

laobie commented Apr 9, 2016

@Aysnine
ok,我测试下给你答复

@laobie
Copy link
Owner

laobie commented Apr 9, 2016

@BelongsH
用你的布局测试了下,你这个界面不应该调用设置透明这个方法,应该调用 setColorForDrawerLayout
就没问题的。
当你的toolbar使用图片作背景的话,设置透明的话是有问题的。这个我还在修复中。
image

@laobie
Copy link
Owner

laobie commented Apr 9, 2016

@Aysnine 你看看你是不是也是这个问题

@Aysnine
Copy link

Aysnine commented Apr 9, 2016

@laobie 可行,StatusBar 的位置出现,但是颜色不对,设置的和 Toolbar 一样的颜色,但是变色了,偏紫。

侧滑出的 Drawer 没问题,上方正常透明。

捉急,原谅我上不了图|・ω・`)

@laobie
Copy link
Owner

laobie commented Apr 9, 2016

@Aysnine 那个不是偏紫色,那个是一个透明度遮罩,如果是纯色不加遮罩的话你可以用另外一个方法,你看我给你的截图,或者看源码有注释的。
image

按照你的需求,你需要的是第二个方法setColorNoTranslucentForDrawerLayout

@Aysnine
Copy link

Aysnine commented Apr 9, 2016

@laobie 真•偏紫,试过 NoTranslucent ,Serious,浅蓝加遮罩会紫?不信你看看 gmail (:з」∠)

@laobie laobie closed this as completed Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants