Git Product home page Git Product logo

Comments (12)

yiplee avatar yiplee commented on June 1, 2024

为啥会导致 fake bar 的 frame 有问题呢?
有截图或者能重现问题的代码吗?

from ypnavigationbartransition.

Z-hui avatar Z-hui commented on June 1, 2024

能提供个联系方式吗,qq或者微信 我截图发您一下,主要原因是我设置的不透明,但是你这一步自己写了个透明的configuration

if (toVC.extendedLayoutIncludesOpaqueBars ||
navigationBar.translucent) {
fakeBarFrame.origin.y = 0;
}

我的零点是在导航下方,没设置在顶部,你这个必须要设置0点在导航栏上方吗

from ypnavigationbartransition.

yiplee avatar yiplee commented on June 1, 2024

设置一个透明的 configure 是为了把真正的导航栏变成透明的,这样两个 fake bar 才能显示出来。

你的导航栏是 opaque 的,然后 self.view 的左上角在导航栏底部,这种情况我建议你设置你的 viewControllerextendedLayoutIncludesOpaqueBars 为 YES,即使导航栏是不透明的,也让 self.view 到导航栏下面去。

然后控制好 scrollview 的 content insets 就没问题了。

from ypnavigationbartransition.

Z-hui avatar Z-hui commented on June 1, 2024

if (toVC.extendedLayoutIncludesOpaqueBars ||
navigationBar.translucent) {
// fakeBarFrame.origin.y = 0;
}

我把这句话删掉就可以解决我的问题,正常cover回来的frame就是-64,你这里改为0会倒置fakebar在导航下方,你这里是否可以兼容一下,不要强制0点在上面,我这是老工程,如果改0点所有页面都得改。

from ypnavigationbartransition.

Z-hui avatar Z-hui commented on June 1, 2024

你这里为么要判断这个navigationBar.translucent,你这个只要显示fakebar必然是透明的,你应该判断showConfigure也就是目标vc的透明度,来做兼容是否修改frame

from ypnavigationbartransition.

Z-hui avatar Z-hui commented on June 1, 2024

这样其他人接入的时候就不会有限制必须设置 extendedLayoutIncludesOpaqueBars 为 YES或者edgesForExtendedLayout,你都可以兼容

from ypnavigationbartransition.

Z-hui avatar Z-hui commented on June 1, 2024

if (toVC.extendedLayoutIncludesOpaqueBars ||
showConfigure.translucent) {
fakeBarFrame.origin.y = 0;
}

这样改

from ypnavigationbartransition.

yiplee avatar yiplee commented on June 1, 2024

你测一下把 navigationBar.translucent 的判断去掉是不是在你的 app 所有需要用 fake bar 的地方没问题。我晚些时候有空了来细看一下这块,测一下别的用例,你着急的话可以先 fork 一份用你改过的版本。

确认问题之后我会在近期发布更新。感谢反馈!

from ypnavigationbartransition.

yiplee avatar yiplee commented on June 1, 2024

我记得是之前遇到了什么问题我才改成这样的,但具体啥问题想不起来了。

from ypnavigationbartransition.

Z-hui avatar Z-hui commented on June 1, 2024

嗯我先改成if (toVC.extendedLayoutIncludesOpaqueBars ||
showConfigure.translucent) {
fakeBarFrame.origin.y = 0;
}我先用着 ,我这测试我这是用没问题,你可以测试一下0点在导航上方的做下兼容,你本身写的判断就是有问题的,是一个一定会走的判断因为导航一定是透明在显示fakevbar的情况下,有时间你可以更新一下,哈哈

from ypnavigationbartransition.

yiplee avatar yiplee commented on June 1, 2024

提个 PR 给我吧,可能把 navigationBar.translucent 改成 showConfigure.translucent 就解决所有问题了。

from ypnavigationbartransition.

yiplee avatar yiplee commented on June 1, 2024

#16

发布在 2.0.5 版本了。

from ypnavigationbartransition.

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.