uinavigationcontroller

Navigation Bar Blinks When Animating for the First Time

北城余情 提交于 2021-02-07 19:58:50
问题 I have created my own tabbarcontroller of sorts, but am having an issue with animation. When I animate the views on tab click, the navigation bar turns completely black (should be red), then blinks back to red after the animation completes. My setup and code is below. (Answers in either swift or objective-c are helpful since the tranlastion is easy) Thanks in advance! red: Navigation Bar blue: Navigation Display View grey: Tab Bar burgundy: Tab Bar Display View (This is the part being

Properly redirect to a view controller inside tab bar's navigation controller when push notification is clicked

痴心易碎 提交于 2021-02-07 14:35:12
问题 I have a tabBar . Each of its tabs' ViewControllers have been embedded inside their respective NavigationControllers . Hierarchy: Tabbarcontroller --> NavigationController --> VC1 --> VC2 -->...VCn (for tab1) I have to redirect to one of the viewcontrollers say VC2 when i click on push notifications. The code i am using is as follows. let navigationController = UINavigationController() let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) if let chatViewController = storyboard

Properly redirect to a view controller inside tab bar's navigation controller when push notification is clicked

限于喜欢 提交于 2021-02-07 14:32:29
问题 I have a tabBar . Each of its tabs' ViewControllers have been embedded inside their respective NavigationControllers . Hierarchy: Tabbarcontroller --> NavigationController --> VC1 --> VC2 -->...VCn (for tab1) I have to redirect to one of the viewcontrollers say VC2 when i click on push notifications. The code i am using is as follows. let navigationController = UINavigationController() let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) if let chatViewController = storyboard

Back button does not show up in navigation controller

青春壹個敷衍的年華 提交于 2021-02-07 11:36:06
问题 I have added a show segue from table cell in one view controller to another table view embedded in a navigation controller. When I click on the cell in the first view the segue works as expected and brings up the new view. However, the "Back" button (with the title of the original view) does not appear in the navigation bar. I searched SO and found a number of such questions asked in the past (both for Swift and Objective-C). Most of them suggest that the first view needs a title for this to

UIRefreshControl not showing in landscape when in a navigation controller with large titles

我的未来我决定 提交于 2021-02-07 09:16:15
问题 I have a plain UITableViewController embedded in a UINavigationController which prefers large titles . I added a refresh control to my table view controller. On iPhone in iOS 11, if I launch my app in portrait mode, switch to landscape and begin refreshing the table view, the refresh control does not show up . The refresh happens, but the control is just not present. It's not even in the view hierarchy: Note that the same does work on iPhone if I'm in portrait mode, and also on iPad in every

UINavigationBar with Large Titles - how to find extra height in iOS 11

巧了我就是萌 提交于 2021-02-07 06:07:04
问题 When using prefersLargeTitles for a UINavigationController 's UINavigationBar in iOS 11 , the nav bar increases height. The increase is from 44 to 96 on the iPhones I have checked, but I think those numbers can change per device (or at least we need to code as if they can). I want to programmatically find the 'extra' height - the height of the large titles area that is added beneath the traditional UINavigationBar when a large title is displayed. I can easily find the entire height of the bar

UINavigationBar with Large Titles - how to find extra height in iOS 11

无人久伴 提交于 2021-02-07 06:05:56
问题 When using prefersLargeTitles for a UINavigationController 's UINavigationBar in iOS 11 , the nav bar increases height. The increase is from 44 to 96 on the iPhones I have checked, but I think those numbers can change per device (or at least we need to code as if they can). I want to programmatically find the 'extra' height - the height of the large titles area that is added beneath the traditional UINavigationBar when a large title is displayed. I can easily find the entire height of the bar

assigning a custom destination to popToRootViewController swift 4

亡梦爱人 提交于 2021-01-29 10:37:47
问题 I am using navigationController?.popToRootViewController(animated: true) to dismiss my current view to the previous view. My view controller relationship looks like this. VC1->VC2 VC1->VC3 VC3->VC2 Whenever the client is in VC2 I want to pop the navigation controller back to VC1. This works fine when the rootviewcontroller is set to VC1. However, when the client uses a segue from VC3 to enter VC2, the rootviewcontroller is set to VC3 and the navigation controller pops to VC3. I tried to

SwiftUI - Navigation bar colour change not being applied to status bar

时光毁灭记忆、已成空白 提交于 2021-01-28 11:57:47
问题 I have the following: var body: some View { NavigationView { VStack { Text("Hello") }.navigationBarTitle("Edit Profile", displayMode: .inline) .background(NavigationConfiguration { nc in nc.navigationBar.barTintColor = .red nc.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.black] }) }.navigationViewStyle(StackNavigationViewStyle()) } For the configuration of the nav bar i have: struct NavigationConfiguration: UIViewControllerRepresentable { var configuration:

Clickable Navbar title

心不动则不痛 提交于 2021-01-27 21:30:14
问题 How can I make the title of a navbar clickable. Much like in the facebook application. Were when you click it it dismisses the view controller. 回答1: set a UIButton as UINavigationItem's titleView .. add an action to that button.. for more details read UINavigationItem class reference 来源: https://stackoverflow.com/questions/3572346/clickable-navbar-title