Code Monkey home page Code Monkey logo

Comments (15)

laobie avatar laobie commented on May 27, 2024

目前还不行,等我有空研究下这个

from statusbarutil.

hunao0221 avatar hunao0221 commented on May 27, 2024

好的

Jaeger [email protected]于2016年4月14日周四 23:17写道:

目前还不行,等我有空研究下这个


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#16 (comment)

from statusbarutil.

SeanZom avatar SeanZom commented on May 27, 2024

我添加了一个方法,可以解决根布局的 首个子控件为Imageview 延伸到状态栏这种情况

    /**
     *  为有 ImageView 的Activity 添加半透明状态栏
     *
     * @param act        需要设置的Activity
     * @param marginView 需要设置 margin 的 View
     */
    public static void setTranslucentForImageView(Activity act, View marginView) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            act.getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
                addTranslucentView(act, DEFAULT_STATUS_BAR_ALPHA);
            }
            ViewGroup.MarginLayoutParams vmlp = (ViewGroup.MarginLayoutParams) marginView.getLayoutParams();
            vmlp.setMargins(0, getStatusBarHeight(act), 0, 0);
        } 
    }

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

@SeanZom 等我测试下是否可以 可以的话我更新下

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

@SeanZom 那个值应该是负的= =你写错啦

from statusbarutil.

SeanZom avatar SeanZom commented on May 27, 2024

哪个?没有吧,我跑过4.4和5.0的

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

image
@SeanZom 这个 

from statusbarutil.

SeanZom avatar SeanZom commented on May 27, 2024

没有写错

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

@SeanZom 这个值正的话 是往下移啊 你跑了什么版本的?

from statusbarutil.

SeanZom avatar SeanZom commented on May 27, 2024

原来是使用场景的问题,不是谁对谁错的问题。我一阵传个我的使用例子,现在不在电脑旁。

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

好的

from statusbarutil.

SeanZom avatar SeanZom commented on May 27, 2024
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/iv_header_img"
        android:tag="这个是 头部延伸到状态栏的Image"
        .../>

    <Button
        android:id="@+id/btn_back"
        android:tag="这个是 marginView"
        .../>
</RelativeLayout>

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

哦哦 这样的 ,marginView 不是必须的咯 刚才弄错了 不好意思

from statusbarutil.

SeanZom avatar SeanZom commented on May 27, 2024

你有没有QQ或者其他联系方式方便点沟通。如果要继续探究的话。marginView确实不是必须,但是ImageView依然是可以延伸到状态栏啊,5.0和4.4.4的我都试过

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

@hunao0221 最新的1.2.0 版本已经支持这个了,可以看看,issuse 我关闭了哈

from statusbarutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.