Post

Replies

Boosts

Views

Activity

Reply to Regarding the issue of navigation bar hierarchy in iOS 18
In order to describe the problem more clearly, I have uploaded some files and demo, hoping to understand my difficulties。 My first controller: override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.red // Do any additional setup after loading the view. let companyLogo = UIImageView(image:#imageLiteral(resourceName: "logo")) navigationItem.titleView = companyLogo let customView = UIView(frame: CGRect(x: 200, y: 5, width: 40, height: 20)) customView.backgroundColor = UIColor.blue navigationController?.navigationBar.addSubview(customView) let button = UIButton(type: .custom) button.backgroundColor = UIColor.green button.frame = CGRect(x: 100, y: 300, width: 100, height: 100) self.view.addSubview(button) button.addTarget(self, action: #selector(clickAction), for: .touchUpInside) } Button click event: @objc private func clickAction() { let second = SecondViewController() navigationController?.pushViewController(second, animated: true) } When I execute a back in SecondViewController, during this animation process, customeview is briefly overwritten by navigationItem.titleView. I want to know why this is happening?
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’25
Reply to Xcode16.1&iOS18.1.1 Debugging App, unable to respond “didRegisterForRemoteNotificationsWithDeviceToken” delegation
Perhaps you can tell me what options or settings affect this issue
Replies
Boosts
Views
Activity
Dec ’24
Reply to Regarding the issue of navigation bar hierarchy in iOS 18
I suspect that iOS 18 may have some upgrades and optimizations for animations, which may result in some changes in the view hierarchy for view push or pop. Unfortunately, I did not get more information from the official documentation.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’25
Reply to Regarding the issue of navigation bar hierarchy in iOS 18
In order to describe the problem more clearly, I have uploaded some files and demo, hoping to understand my difficulties。 My first controller: override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.red // Do any additional setup after loading the view. let companyLogo = UIImageView(image:#imageLiteral(resourceName: "logo")) navigationItem.titleView = companyLogo let customView = UIView(frame: CGRect(x: 200, y: 5, width: 40, height: 20)) customView.backgroundColor = UIColor.blue navigationController?.navigationBar.addSubview(customView) let button = UIButton(type: .custom) button.backgroundColor = UIColor.green button.frame = CGRect(x: 100, y: 300, width: 100, height: 100) self.view.addSubview(button) button.addTarget(self, action: #selector(clickAction), for: .touchUpInside) } Button click event: @objc private func clickAction() { let second = SecondViewController() navigationController?.pushViewController(second, animated: true) } When I execute a back in SecondViewController, during this animation process, customeview is briefly overwritten by navigationItem.titleView. I want to know why this is happening?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’25