Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavigationBar Jumping Problem #1289

Open
kamokaizen opened this issue Jan 26, 2020 · 11 comments
Open

NavigationBar Jumping Problem #1289

kamokaizen opened this issue Jan 26, 2020 · 11 comments

Comments

@kamokaizen
Copy link

Hi guys, first of all, thanks for creating such a great UI library. I enjoy using this framework.
Recently, I saw a problem about when navigation back through the back button. The navigation bar is jumping when back button pressed. My code is not customized, it s from sample project. Can you help me to solve jumping?
Screen Recording 2020-01-27 at 12 35 38 AM

Main NavigationController code is below;

class AppNavigationController: NavigationController {
open override func prepare() {
super.prepare()
isMotionEnabled = true
guard let v = navigationBar as? NavigationBar else {
return
}

    v.backgroundColor = .white
    v.depthPreset = .none
    v.dividerColor = Color.grey.lighten2
}

override var preferredStatusBarStyle: UIStatusBarStyle{
    if #available(iOS 13.0, *) {
        return .darkContent
    } else {
        return .default
    }
}

}

These are the root ListViewController UI lifecycle functions. Nothing is special.

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
}

override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)
}
@thuca1992
Copy link

same here. Have you figured it out yet?

@Hamna21
Copy link

Hamna21 commented Feb 7, 2020

Same here as well.

Waiting for feedback!

@kamokaizen
Copy link
Author

Anything about resolving issue guys?

@juvs
Copy link

juvs commented Mar 28, 2020

Take a screenshot of your screen using the "Debug View Hierarchy", try to use certain angle to see how is render the logo used as avatar on your navitgationBar.

Screen Shot 2020-03-27 at 18 39 59

@Gruschka
Copy link

Hi guys, I'm having the same issue! Could anyone figure this one out yet?

@markst
Copy link
Contributor

markst commented Jun 5, 2020

Also experiencing this. Haven't quite figured out why yet!

image

@beom-mingyu
Copy link

same here. Have you figured it out yet?!!

@mgkcorty
Copy link

Same issue. How to solve this?

@serhrez
Copy link

serhrez commented Nov 8, 2020

Same, here's a quick fix though be alerted that it MAY CORRUPT your other views, because I haven't checked other components of this library, but here it is.
Remove these lines of code from the library

//    iOS 11 added left/right layout margin in subviews of UINavigationBar
//    since we do not want to unsafely access private views directly, we
//    iterate through the subviews to set `layoutMargins` to zero
    for v in subviews {
      if #available(iOS 13.0, *) {
        let margins = v.layoutMargins
        v.frame.origin.x = -margins.left
        v.frame.size.width += margins.left + margins.right
      } else {
        v.layoutMargins = .zero
      }
    }

Though, I'd like it to be solved by the creators of the library

@kamokaizen
Copy link
Author

So what do you suggest guys

@kamokaizen
Copy link
Author

@cointowitcher is there any way to resolve this bug ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

9 participants