Closed xiky closed 6 months ago
Today, in the func show(...)
method, I came across the logic if !animatePosBar || (animatePosBar && style == .push) {}
.
I changed it to (animatePosBar && style != .none)
, which temporarily resolved the issue of the navigationBar
displaying the centerBarView
text of c
's defaultBarTitle
when returning from c
to b
.
However, the animation flickers during the return process. I hope there is a more correct method to modify this.
If there is a better way, I hope to receive your assistance. Thank you sincerely once again.
Hello, as a developer who is just learning macOS development, I chose to learn from the source code of the great project
Telegram
. I encountered the following problem when reading the source code:The way I test entering 'a' (
rightController.push(a, false, style: ViewControllerStyle.none)
) or (rightController.push(a, true, style: ViewControllerStyle.push)
) does not affect 'b'.When pushing from a controller 'a' with
bar = .init(height: 0)
to a controller 'b' withbar = .init(height: 50)
(navigationController?.push(b)
), and then from 'b' pushing to a controller 'c' withbar = .init(height: 0)
(navigationController?.push(c)
), the navigation bar on 'c' appears.Also, when returning to 'b', 'c's bar will cover 'b' (phenomenon is: the text in 'b's
titleBarView
displays 'b'sdefaultBarTitle
, the reason being that pushing 'c' will setcenterBarView = getCenterBarViewOnce()
inloadView
).I noticed that in
NavigationViewController
,push
calls thefunc show(_ controller: ViewController, _ style: ViewControllerStyle) -> Void {}
, In the show method, there are a few lines of code like this:After adding my modifications, 'b' pushing 'c' could be done without displaying the navigation, but when 'c' pops to 'b', it still covers the content of 'b's
titleBarView
.So, how should I modify the code in
NavigationViewController
to solve this problem?Would you be willing to help me out with the problem I encountered while learning? I would be so grateful for your help.
Thank you for your time, sincerely appreciate it.