uinavigationcontroller

Prevent automatic popToRootViewController on double-tap of UITabBarController

99封情书 提交于 2019-12-27 17:39:07
问题 The default behavior of a UITabBarController is to pop the contained UINavigationController to the root view controller when a particular tab is tapped a second time. I have a particular use case where I'm wanting this to not work automatically, and I'm having a hard time figuring out how to prevent this. Has anyone run into this, and if so, what did you do? Do I need to subclass UINavigationController and override popToRootViewController or is there a simpler way? 回答1: Use the

How can I change height of Navigation Bar - Swift 3

 ̄綄美尐妖づ 提交于 2019-12-27 17:37:29
问题 I'm pretty sure this is not duplicate because I looked at other answers and they all outdated and do not provide exact answer. I have Navigation Controller and several view controllers. I want to make Navigation Bar a bit taller so it would fit text size that I need. How can I do that ? I tried this: UINavigationBar.appearance().frame = CGRect(x: 0.0, y: 0.0, width: 320.0, height: 210.0) but nothing happens... Also, I wasn't able to add any constraints to the Nav Bar using Xcode layout

Can i pop to Specific ViewController?

十年热恋 提交于 2019-12-27 17:07:49
问题 I am using navigation based application. I push First ViewController to Second ViewController and from Second ViewController to Third ViewController. Now I want to pop from Third ViewController to First ViewController.I am performing this task using the below code but my application crashed. Please any body give me some proper guidelines. I can't use pop to rootViewController because it's different viewController. Thanks in advance... In Third ViewControler i have written this: FirstViewCtr

Can i pop to Specific ViewController?

南笙酒味 提交于 2019-12-27 17:05:59
问题 I am using navigation based application. I push First ViewController to Second ViewController and from Second ViewController to Third ViewController. Now I want to pop from Third ViewController to First ViewController.I am performing this task using the below code but my application crashed. Please any body give me some proper guidelines. I can't use pop to rootViewController because it's different viewController. Thanks in advance... In Third ViewControler i have written this: FirstViewCtr

Can i pop to Specific ViewController?

二次信任 提交于 2019-12-27 17:05:01
问题 I am using navigation based application. I push First ViewController to Second ViewController and from Second ViewController to Third ViewController. Now I want to pop from Third ViewController to First ViewController.I am performing this task using the below code but my application crashed. Please any body give me some proper guidelines. I can't use pop to rootViewController because it's different viewController. Thanks in advance... In Third ViewControler i have written this: FirstViewCtr

Custom Animation for Pushing a UIViewController

和自甴很熟 提交于 2019-12-27 10:29:50
问题 I want to show a custom animation when pushing a view controller: I would like to achieve something like an "expand" animation, that means the new view expands from a given rectangle, lets say [100,100 220,380] during the animation to full screen. Any suggestions where to start, respectively any documents, tutorials, links? :) Alright. I could make the expand animation with the following code: if ([coming.view superview] == nil) [self.view addSubview:coming.view]; coming.view.frame =

can i use to pass a data with 'navigation controller back button' in xcode

那年仲夏 提交于 2019-12-27 05:07:52
问题 i have 2 view controller and a navigation controller . we shall say main for 1 and detail for 2. when i push button in main, detail opens and main opens with back button well, i want to change a label text or a string in main view controller when i clicked a button and back button on detail view controller. how can i make this? if([segue.identifier isEqualToString:@"deneme"]) { MainViewController *main=[segue destinationViewController]; main.detay=@"denme"; } i tried prepareForSegue and

how to get navigation controller from NSObject class and push a view controller in ios

烈酒焚心 提交于 2019-12-25 18:24:56
问题 I am working in a static library project and I want to push a view controller in navigation controller of iOS project How can I do it ? I am doing it as follows: UIStoryboard * storyboard = [[[UIApplication sharedApplication] keyWindow] rootViewController].storyboard; UIViewController* pushtoVC = [storyboard instantiateViewControllerWithIdentifier:@"home"]; UINavigationController *navController = [[[[UIApplication sharedApplication] keyWindow]rootViewController] navigationController];

UINavigationController popToRootViewController method cannot be called by a delegate?

℡╲_俬逩灬. 提交于 2019-12-25 18:17:59
问题 I have a UINavigationController which works great. Each view controller has its own button that pops the stack back to its root which also works great. However, I'd like to also be able to pop the stack back to its root by pressing a button on the tab bar (which is obviously in an entirely different class outside of the navigation stack). Therefore, I created a delegate in the tab bar class which finds the view controller at the top of the stack and calls the method in that view controller to

Update navigation bar back button image for the whole project

拟墨画扇 提交于 2019-12-25 16:38:29
问题 I need to update the navigation bar back button image for the whole project some sort I achieved this from the code below, But the problem is back button is showing two adjacent lines which are un wanted for me. Please guide me is there any code to remove those lines. let image = UIImage(named:"backButton") let backImage = image?.imageWithRenderingMode(.AlwaysOriginal).resizableImageWithCapInsets(UIEdgeInsetsMake(0, 13, 0, 6)) UIBarButtonItem.appearance().setBackButtonBackgroundImage