uinavigationbar

Large title to small title switch in navigation bar is not smooth iOS 13, sticky

守給你的承諾、 提交于 2020-07-14 03:00:17
问题 I have a UINavigationController with default value of it's navigationBar.prefersLargeTitles = true . I am switching that to false when I push into a new scene lets call it ( DetailsViewController ), by changing it into the viewWillDisappear . override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) navigationController?.navigationBar.prefersLargeTitles = false } Now in DetailsViewController I am using willMove(to parent:) . override func willMove(toParent parent:

Navigation Bar's content partially not visible in modal on iOS 13

两盒软妹~` 提交于 2020-06-27 20:15:42
问题 A storyboard based application is having issue rendering the navigation bar's content when the navigation bar is displayed in a modal screen, but only when on a physical device. The code behaves properly in iOS 12 and in all simulators both iOS 12 and iOS 13.2.2. On the left of the screenshot is a iPhone 11 simulator running iOS 13.2.2; on the right is a Reflector projection of my iPhone Xs running iOS 13.2.2 of the same code. We can see there's a space between the tableview and the

Navigation Bar's content partially not visible in modal on iOS 13

大兔子大兔子 提交于 2020-06-27 20:15:05
问题 A storyboard based application is having issue rendering the navigation bar's content when the navigation bar is displayed in a modal screen, but only when on a physical device. The code behaves properly in iOS 12 and in all simulators both iOS 12 and iOS 13.2.2. On the left of the screenshot is a iPhone 11 simulator running iOS 13.2.2; on the right is a Reflector projection of my iPhone Xs running iOS 13.2.2 of the same code. We can see there's a space between the tableview and the

Navigation Bar's content partially not visible in modal on iOS 13

北战南征 提交于 2020-06-27 20:14:18
问题 A storyboard based application is having issue rendering the navigation bar's content when the navigation bar is displayed in a modal screen, but only when on a physical device. The code behaves properly in iOS 12 and in all simulators both iOS 12 and iOS 13.2.2. On the left of the screenshot is a iPhone 11 simulator running iOS 13.2.2; on the right is a Reflector projection of my iPhone Xs running iOS 13.2.2 of the same code. We can see there's a space between the tableview and the

How to set color `rightBarButtonItem` on navigation bar?

浪尽此生 提交于 2020-06-27 07:31:22
问题 I want to set color of "Done" button on navigation bar like this image: Although, I've set code as self.doneButton.enabled = NO; but Done button still has a white color. It does not change color like image. How to set the code to change text color done button like Done button in the image above? Please help me to solve this problem. I appreciate your help. 回答1: for change the color of barbutton use objective C self.navigationItem.rightBarButtonItem = yourRightbarbuttonName; self

Changing font color of UIBarButtonItem

寵の児 提交于 2020-06-11 16:53:07
问题 I tried to change the font color of the right bar button item to purple, but it still shows up as white. I've consulted this question and this question. How do I fix this? Code let sortButton = UIButton(frame: CGRect(x: 0, y: 0, width: 34, height: 15)) sortButton.setTitle("SORT", for: .normal) sortButton.titleLabel?.tintColor = UIColor.myMusicPurple sortButton.tintColor = UIColor.myMusicPurple navigationItem.rightBarButtonItem = UIBarButtonItem(customView: sortButton) navigationItem

After Add a CustomView to navigationItem, CustomView always return nil

旧城冷巷雨未停 提交于 2020-05-17 07:29:04
问题 Bellow code is adding a customView to navigationItem successfully, but when trying to access the customView it always return nil override func viewDidLoad() { super.viewDidLoad() let customView = getCustomView() // supposed that the function return a custom view let actionButton = UIBarButtonItem(customView: customView) self.navigationItem.rightBarButtonItem = actionButton // successfully added customView print(navigationItem.rightBarButtonItem?.customView) // print always nil } Result : nil

Hide navigation bar after using search bar

旧城冷巷雨未停 提交于 2020-05-13 07:14:45
问题 I have hidden my navigation bar in my table view controller, but after selecting the search bar and then dismissing it with Cancel it shows the navigation bar again. I tried -(void)searchBarTextDidEndEditing:(UISearchBar *)searchBar { self.navigationController.navigationBar.hidden = YES; } But it did not work, it did hide the navigation bar from the detail view though, but that was not desired. In storyboard I have a tabBarController --> navigationController --> tableView --> detailview.

Hide navigation bar after using search bar

社会主义新天地 提交于 2020-05-13 07:12:46
问题 I have hidden my navigation bar in my table view controller, but after selecting the search bar and then dismissing it with Cancel it shows the navigation bar again. I tried -(void)searchBarTextDidEndEditing:(UISearchBar *)searchBar { self.navigationController.navigationBar.hidden = YES; } But it did not work, it did hide the navigation bar from the detail view though, but that was not desired. In storyboard I have a tabBarController --> navigationController --> tableView --> detailview.

How to animate a button change in UINavigationBar?

巧了我就是萌 提交于 2020-04-08 08:36:50
问题 I am calling the -(void)setEditing:(BOOL)editing animated:(BOOL)animated method in my code to swap between two buttons on the RHS of my navigation bar. -(void)setEditing:(BOOL)editing animated:(BOOL)animated { [super setEditing:editing animated:animated]; // Toggle ‘+’ and ‘Add To Order’ button. if( editing ) { self.navigationItem.rightBarButtonItem = self.addItemButton; } else { self.navigationItem.rightBarButtonItem = self.addToOrderButton; } } Where self.addItemButton and self