AMScrollingNavbar icon indicating copy to clipboard operation
AMScrollingNavbar copied to clipboard

Bottom View popups issue on showNavBar when followerView exists

Open alexookah opened this issue 7 years ago • 21 comments

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:

  1. when showNavBar is triggered.

  2. when checkForPartialScroll is triggered from semi to extened.

reproduce full code here: https://github.com/Alexookah/AMScrollingNavbar

alexookah avatar Mar 06 '18 12:03 alexookah

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)

andreamazz avatar Mar 06 '18 14:03 andreamazz

any update for this issue @andreamazz ?

alexookah avatar May 29 '18 10:05 alexookah

did you have a chance to look at this issue @andreamazz ?

alexookah avatar Sep 30 '18 10:09 alexookah

@Alexookah can you please update the project and check it again?

StefaniOSApps avatar Oct 17 '18 09:10 StefaniOSApps

@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

alexookah avatar Oct 28 '18 09:10 alexookah

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)

alexookah avatar Nov 19 '19 16:11 alexookah

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 avatar Nov 21 '19 15:11 andreamazz

@andreamazz what about if we could extend the view's height before the animation so that there is no lagging showing up?

alexookah avatar Nov 26 '19 10:11 alexookah

It might feel just as glitchy unfortunately. Let me try, I'll let you know

andreamazz avatar Nov 26 '19 10:11 andreamazz

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?

alexookah avatar Nov 26 '19 10:11 alexookah

Checkout branch issue-302, I separated the update of the height and the origin. Let me know how it feels.

andreamazz avatar Nov 26 '19 10:11 andreamazz

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?

alexookah avatar Nov 26 '19 11:11 alexookah

Removing those offsets result in a longer view that extends over the safe area, the glitch is still there, but it's not visible.

andreamazz avatar Nov 26 '19 11:11 andreamazz

maybe this is a workaround?

alexookah avatar Nov 26 '19 11:11 alexookah

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

andreamazz avatar Nov 26 '19 11:11 andreamazz

Yes this looks like its fixed now 👍 merge this to master

alexookah avatar Nov 26 '19 11:11 alexookah

maybe layoutIfNeeded needs also the followers?

alexookah avatar Nov 26 '19 11:11 alexookah

maybe layoutIfNeeded needs also the followers?

Yeah, good point, I'll update the code and merge

andreamazz avatar Nov 26 '19 13:11 andreamazz

Ok, up in master

andreamazz avatar Nov 26 '19 14:11 andreamazz

this looks now fixed. finally the issue has been fixed after one and half year. closing this issue Great work :)

alexookah avatar Nov 26 '19 14:11 alexookah

https://streamable.com/cnrpz weird. sometimes the bottom view shows up sometimes not is it worth investigating? @andreamazz maybe forgot something to layoutIfNeeded?

alexookah avatar Nov 26 '19 15:11 alexookah