AMScrollingNavbar
AMScrollingNavbar copied to clipboard
Bottom View popups issue on showNavBar when followerView exists
https://streamable.com/f7q3g
check the above video.
using:
UINavigationBar.appearance().isTranslucent = false
In Sampler / TableView
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let navigationController = self.navigationController as? ScrollingNavigationController {
navigationController.showNavbar(animated: true, duration: 0.2)
}
}
and
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
cell.backgroundColor = .lightGray
}
I noticed there is a bottomView Poping from the bottom when using a follower View. This happens in two situations:
-
when showNavBar is triggered.
-
when checkForPartialScroll is triggered from semi to extened.
reproduce full code here: https://github.com/Alexookah/AMScrollingNavbar
Hey @Alexookah
thanks for providing the code, I'll make sure to test this out.
It shouldn't be a bottom view though, I think it's the superview holding the table view (when the navbar is hidden, the tableview needs gets taller, when the navbar shows, the table shrinks back to its place... looks like the animation is getting messed up)
any update for this issue @andreamazz ?
did you have a chance to look at this issue @andreamazz ?
@Alexookah can you please update the project and check it again?
@StefaniOSApps @andreamazz i updated the project and checked, the issue stil exists in the latest version of AMScrollingNavBar
i also made another video reproduce presentation: https://streamable.com/hggk4
This still remains an issue. Wow. any ideas how to fix this anyone?
(just updated my fork repo to see if the issue still remains)
Hey @Alexookah I'm not sure how to fix this unfortunately. The controller updates its view correctly, the glitch you see is autolayout lagging behind in updating the view. It's clearer in the Scrollview sample, you can see the white background of the view instantly, and the blue of the scrollview lags a bit to cover the distance. If anyone has any idea on how to work around this, it'd be a huge help.
@andreamazz what about if we could extend the view's height before the animation so that there is no lagging showing up?
It might feel just as glitchy unfortunately. Let me try, I'll let you know
https://github.com/andreamazz/AMScrollingNavbar/blob/master/Source/ScrollingNavigationController.swift#L543
if you remove the navBarY from the height it seems its not glitching.... but then i think we loose the tab bar ? maybe this shows that the navBarY is static during the animation? maybe it should be shown after the animation?
Checkout branch issue-302, I separated the update of the height and the origin. Let me know how it feels.
The same issue still exists when showNavBarCallback is called with collapsed navbar.
i added the else without the calculations
if updateViewHeight {
frame.size = CGSize(width: frame.size.width, height: view.frame.size.height - (navBarY) - tabBarOffset)
} else {
frame.size = CGSize(width: frame.size.width, height: view.frame.size.height)
}
And noticed that there is no issue when i release the scrolling from the middle of my navbar that is going from collapsed to expand
In which when i added the (navBarY) - tabBarOffset inside else it shows a small area jumping Maybe this means something?
Removing those offsets result in a longer view that extends over the safe area, the glitch is still there, but it's not visible.
maybe this is a workaround?
Ok, I'm a massive idiot, I should have realized it as soon as I wrote "autolayout" above, I needed to force a layoutIfNeeded.
Pull the new commit from branch issue-302, let me know
Yes this looks like its fixed now 👍 merge this to master
maybe layoutIfNeeded needs also the followers?
maybe layoutIfNeeded needs also the followers?
Yeah, good point, I'll update the code and merge
Ok, up in master
this looks now fixed. finally the issue has been fixed after one and half year. closing this issue Great work :)
https://streamable.com/cnrpz weird. sometimes the bottom view shows up sometimes not is it worth investigating? @andreamazz maybe forgot something to layoutIfNeeded?