Material
Material copied to clipboard
NavigationBar Jumping Problem
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?
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)
}
same here. Have you figured it out yet?
Same here as well.
Waiting for feedback!
Anything about resolving issue guys?
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.
Hi guys, I'm having the same issue! Could anyone figure this one out yet?
Also experiencing this. Haven't quite figured out why yet!
same here. Have you figured it out yet?!!
Same issue. How to solve this?
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
So what do you suggest guys
@cointowitcher is there any way to resolve this bug ?