uinavigationcontroller

Navigate Back to previous view controller

回眸只為那壹抹淺笑 提交于 2020-01-10 07:32:14
问题 I have a UIView->UICollectionView->UICollectionViewCell . I am trying to navigate back programatically but none of these works. The code did called. I am using StoryBoard. - (void) goBack:(NSNotification *) notification { // [self.navigationController popViewControllerAnimated:YES]; // [self dismissViewControllerAnimated:YES completion:nil]; [self.navigationController popToRootViewControllerAnimated:YES]; } 回答1: You need to use: [self.navigationController popToRootViewControllerAnimated:YES];

How to change the tab bar image color for selected and unselected

对着背影说爱祢 提交于 2020-01-10 06:15:31
问题 I'm trying to change the color of a tab bar item in iOS app. The child view controllers are embedded in an navigation controller. I have added this code in AppDelegate which just changes the color of the text. [UITabBarItem.appearance setTitleTextAttributes: @{NSForegroundColorAttributeName : [UIColor colorWithRed:38/255.0 green:54/255.0 blue:73/255.0 alpha:1.0]} forState:UIControlStateNormal]; [UITabBarItem.appearance setTitleTextAttributes:@{NSForegroundColorAttributeName :

How to change the tab bar image color for selected and unselected

拥有回忆 提交于 2020-01-10 06:14:48
问题 I'm trying to change the color of a tab bar item in iOS app. The child view controllers are embedded in an navigation controller. I have added this code in AppDelegate which just changes the color of the text. [UITabBarItem.appearance setTitleTextAttributes: @{NSForegroundColorAttributeName : [UIColor colorWithRed:38/255.0 green:54/255.0 blue:73/255.0 alpha:1.0]} forState:UIControlStateNormal]; [UITabBarItem.appearance setTitleTextAttributes:@{NSForegroundColorAttributeName :

Navigationbar title and back button name are same?

限于喜欢 提交于 2020-01-10 02:03:35
问题 I created one title for navigationbar in my storyboard project ,but when I moved to next viewcontroller the back button shows the same name as my previous navigationbar(Main navigationbar) title.? Can i set separate title and back button names? I tried following code but its not working ? why? self.navigationItem.title=@"Recent Books"; self.navigationItem.backBarButtonItem.title=@"Back"; 回答1: According to UINavigationItem Class Reference "When this navigation item is immediately below the top

NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController

六月ゝ 毕业季﹏ 提交于 2020-01-09 08:37:28
问题 so I'm making an app with 5 view controllers, the first is embedded in a UINavigationController and the segue between the first 4 view controllers works fine. However introducing a 5th View Controller has broken this, and I'm getting the error Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.' I havent done anything differently with this 5th view controller, its

NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController

丶灬走出姿态 提交于 2020-01-09 08:37:11
问题 so I'm making an app with 5 view controllers, the first is embedded in a UINavigationController and the segue between the first 4 view controllers works fine. However introducing a 5th View Controller has broken this, and I'm getting the error Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.' I havent done anything differently with this 5th view controller, its

Set a custom subclass of UINavigationBar in UINavigationController programmatically

最后都变了- 提交于 2020-01-08 18:17:38
问题 Does anyone know how can I use my custom subclass of UINavigationBar if I instantiate UINavigationController programmatically (without IB)? Drag a UINavigationController in IB show me an under Navigation Bar and using Identity Inspectory I can change class type and set my own subclass of UINavigationBar but programmatically I can't, navigationBar property of Navigation Controller is readonly... What should I do to customize the navigation bar programmatically? Is IB more "powerful" than "code

How to remove the shadow line from a navigation bar?

你离开我真会死。 提交于 2020-01-07 06:54:06
问题 I added a UINavigationController to my UIViewController programmatically like following: UINavigationController * nc = [[UINavigationController alloc] initWithRootViewController:[ViewController fromStoryboardNamed:@"myVC"]]; and in the debug view hierarchy I see there is a view called UIBackdropView behind the UINavigationBar with gray color background. You can see that in the screenshot: I tried to find it in the Documentation,but I couldn't find any. Can we access this layer? This causes a

UITabBarControllers and UINavigationControllers

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-07 04:58:21
问题 Problem I have an app with a UITabBarController and four different tabs. Three of these tabs are tables which you can click on each row and it would take you to another view. Question How would I implement that in terms of navigation? Should I create a UITabBarController with Navigation Controllers as tabs (as shown in image 1) or with View Controllers as tabs (as shown in image 2) with each View Controller having its own Navigation Controller property? Image 1: Image 2: I tried both but its

Dismiss View Controller unexpected behaviour

人走茶凉 提交于 2020-01-07 03:12:13
问题 I am facing strange issue regarding Present and Dismiss ViewController. For e.g :- I am at ViewController A then i push to B So in Navigation Controller Stack we have [A,B] Now if i present any view controller on B (Like MFMailComposeViewController) Then after sending mail or deleting draft it dismiss the MFMailComposeViewController and it redirects to A instead of B. I have researched regarding this but can't find any alternative. 回答1: if you have called Popviewcontroller method in