Material icon indicating copy to clipboard operation
Material copied to clipboard

NavigationBar Jumping Problem

Open kamokaizen opened this issue 5 years ago • 11 comments

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)
}

kamokaizen avatar Jan 26 '20 21:01 kamokaizen

same here. Have you figured it out yet?

thuca1992 avatar Feb 06 '20 18:02 thuca1992

Same here as well.

Waiting for feedback!

Hamna21 avatar Feb 07 '20 06:02 Hamna21

Anything about resolving issue guys?

kamokaizen avatar Feb 24 '20 12:02 kamokaizen

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

juvs avatar Mar 28 '20 00:03 juvs

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

Gruschka avatar May 20 '20 12:05 Gruschka

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

image

markst avatar Jun 05 '20 05:06 markst

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

beom-mingyu avatar Jun 28 '20 02:06 beom-mingyu

Same issue. How to solve this?

mgkcorty avatar Aug 30 '20 20:08 mgkcorty

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

serhrez avatar Nov 08 '20 19:11 serhrez

So what do you suggest guys

kamokaizen avatar Feb 23 '21 11:02 kamokaizen

@cointowitcher is there any way to resolve this bug ?

kamokaizen avatar Oct 13 '21 12:10 kamokaizen