GithubHelp home page GithubHelp logo

Comments (7)

gyf-dev avatar gyf-dev commented on May 16, 2024

@smallgirl
你下载我的demo在你这款手机上使用方法三可以正常使用吗?

from immersionbar.

chengzichen avatar chengzichen commented on May 16, 2024

demo中方案三在部分的4.4手机上是有些问题,在4.4联想手机上有问题,但是在4.4htc没有问题

from immersionbar.

gyf-dev avatar gyf-dev commented on May 16, 2024

能贴个图吗?或者加我微信想聊

from immersionbar.

smallgirl avatar smallgirl commented on May 16, 2024

@gyf-dev @chengzichen 在三星手机也不行,理论上上载所有手机都不行,因为在setupStatusBarView()方法里面没有处理,而

 /**
     * 解决安卓4.4和EMUI3.1导航栏与状态栏的问题
     */
    private void solveNavigation() {
        // 解决android4.4有导航栏的情况下,activity底部被导航栏遮挡的问题
        if (mConfig.hasNavigtionBar() && !mBarParams.fullScreenTemp && !mBarParams.fullScreen) {
            if (mConfig.isNavigationAtBottom()) { //判断导航栏是否在底部
                if (mBarParams.fits)
                    mContentView.setPadding(0, getStatusBarHeight(mActivity), 0, mConfig.getNavigationBarHeight()); //有导航栏,获得rootView的根节点,然后设置距离底部的padding值为导航栏的高度值
                else
                    mContentView.setPadding(0, 0, 0, mConfig.getNavigationBarHeight());
            } else {
                if (mBarParams.fits)
                    mContentView.setPadding(0, getStatusBarHeight(mActivity), mConfig.getNavigationBarWidth(), 0); //不在底部,设置距离右边的padding值为导航栏的宽度值
                else
                    mContentView.setPadding(0, 0, mConfig.getNavigationBarWidth(), 0);
            }
        } else {
           // mContentView.setPadding(0, 0, 0, 0); //没有导航栏,什么都不做
        }
    }

这个方法处理的只是有底部导航栏的手机,对于底部没有导航栏的手机,没做处理,其次我在setupStatusBarView() 方法里加上mContentView.setPadding(0, getStatusBarHeight(mActivity), 0, 0);可以但是有bug,就是activity 必须继承AppCompatActivity 不能继承Activity 不然如果状态栏与布局的第一个view颜色一样,会出现一条黑线,微信wanghaitao2016

from immersionbar.

gyf-dev avatar gyf-dev commented on May 16, 2024

@smallgirl
这是由于上次修改bug导致这一块代码有修改,然后忘了处理没有导航栏的情况,下个版本修复,至于继承activity有一条黑线的情况下,在style里设置下面属性即可解决

<item name="android:windowContentOverlay">@null</item>

from immersionbar.

scsfwgy avatar scsfwgy commented on May 16, 2024

@gyf-dev 你好,@null这句话加上在华为4.4上确实解决了黑线问题。不知道lib是否更新,我用的是最新的库,翻了很久issues好久才找到这,如果没有更新lib希望可以放到首页,因为不太好找!谢谢作者,辛苦了~

from immersionbar.

scsfwgy avatar scsfwgy commented on May 16, 2024

<item name="android:windowContentOverlay">@null</item>

from immersionbar.

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.