andreamazz / andreamazz/AMScrollingNavbar

iOS 13 TabBar position is invalid after resuming device from lock

未关闭
#373 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Swift
星标
6k
派生
628
PR 合并指标
30 天内没有已合并 PR

描述

**Describe the bug**
First of all I would like to thank you again for this library, I use it in my apps and it makes the user experience much more pleasurable.
I've been updating my app for iOS 13 and I've noticed an invalid behaviour of the Scrolling NavBar, TabBar to be exact.
If the device is locked and the NavBar/TabBar is collapsed, then its position is invalid, when the device wakes back up. The problem can be seen in the gif I've attached.

The problem appears when also presenting other VCs onto the VC that has the ScollingNavBar, such as when presenting a SideMenu, in my case.

**To Reproduce**
Steps to reproduce the behavior:
1. Make the TabBar collapse.
2. Lock the device/simulator
3. Unlock the device, the TabBar will be visible, but in the .collapsed state, so once you scroll up, the TabBar moves above its normal position.
(Tested on iPhone 11 Pro Max iOS 13 Simulator, which didn't seem to happen on iOS 12 and below after fixing #321 )

**Expected behavior**
The TabBar should either be collapsed when waking, or have the correct state so it does not go above its normal position

**Screenshots**
Here's the gif of the problem. [gif](https://gph.is/g/4LNBQ3p)

After taking a look at the source code, I believe that the `scrollWithDelta` function gets called before the `didBecomeActive` function, thus making the `previousState` param always `.expanded` before the `didBecomeActive` checks its value. All of these are in the ScrollingNavigationController class.

I'll do some more digging and report here if I find a fix, any ideas are appreciated

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。