uinavigationcontroller

UINavigationController and presenting a modal controller

≡放荡痞女 提交于 2019-12-19 12:08:15
问题 If got a rootViewController which display's a UIScrollView full screen. When I tap the UIScrollview, I want to flip the screen and display a settings screen (which also has a second screen, the reason for the navigationController). I am able to display the settings screen by using the following code in my rootViewController: self.navController = [[UINavigationController alloc] initWithRootViewController:self.settingsViewController]; and than: [self.navController pushViewController:self

uitabbarcontroller / uitabbar in navigation based project

大城市里の小女人 提交于 2019-12-19 10:46:06
问题 I have created navigation based project. and in second screen i want to add uitabbarcontroller. so can any one suggest how i do this. i already did lot of search but no success yet. so please can you provide a simple sample of this. i already tried below discussion but i think its not a good approach. Navigation Based Application with TabBar Thanks 回答1: Actually this is the correct approach. The one thing that is not correct is where the controllers are allocated. This is happened in the

How to put a UISegmentedControl under a NavigationController?

…衆ロ難τιáo~ 提交于 2019-12-19 10:35:27
问题 I was wondering what the best approach in order to have a UISegmentedControl appears just under the a navigationController just like in the AppStore application: The content I what to put in the different views are UITableView just like the AppStore app. What I was thinking so far was: a viewController with the UIToolbar with UISegmentedController in this ViewController attaching my UITableViews But what I can't figure out, is how to structure my controller source code files. Do you have best

Adding a custom label in toolbar doesn't work

旧城冷巷雨未停 提交于 2019-12-19 10:12:34
问题 I'm trying to add a custom label in my UINavigationController's toolbar. I followed the top answer for this question but it doesn't seem to work for me and I don't know why. The custom text doesn't appear, but the button is there. It highlights when I press it but it has no text. Here's my code: - (void) editToolbar{ NSArray *toolbarItemsCopy = [self.toolbarItems copy]; //set up the label self.notificationsLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0 , 11.0f, self.view.frame.size

UITabBarController UINavigationController Design Advice

房东的猫 提交于 2019-12-19 09:23:18
问题 This is more of a philosophical question than anything, so give me your thoughts. The iPhone SDK documentation specifies that you may have a tab bar controller contain a navigation controller, but you can't have a navigation controller contain a tab bar controller. It seems that there are times when you might want to organize views within a view that is part of a navigation controller stack in a tabular fashion. Is this unreasonable? I accept what Apple dictates in these areas as gospel as

how to push view controller from a UIView's subclass

丶灬走出姿态 提交于 2019-12-19 09:16:41
问题 I created a view " CategoryTableView " that subclass from UIView . And CategoryTableView contains a UITableView . I added CategoryTableView as a subview to HomeViewController that subclass from UIViewController . Right now, I want to push a new view controller when didSelectRowAtIndexPath executes. But, in CategoryTableView , how do I push or present another view controller. I can't get to the navigation controller in CategoryTableView . 回答1: CategoryTableView.h @property (retain, nonatomic)

iOS 5 [UINavigationBar appearance] setBackgroundImage does not do work

天涯浪子 提交于 2019-12-19 08:09:07
问题 I created a new test iOS5 project in Xcode 4.2 Build 4D199 and tried to set the appearance of the UINavigationBar as described above, but nothing happens. The code I tried in the viewDidLoad : [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navbar-iphone.png"] forBarMetrics:UIBarMetricsDefault]; The only way I can get it to work is to set the appearance on the instance of the UINavigationBar . Like: [self.navigationController.navigationBar setBackgroundImage:[UIImage

Why doesn't my root view's height take account of its navigation bar?

房东的猫 提交于 2019-12-19 08:01:01
问题 I was under the impression that a UINavigationController's navigation bar would always push down the child view's height, such that the child view's origin was at the bottom of the title bar. But when I present a view controller like this ... MyViewController *viewController = [[MyViewController alloc] init]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; viewController.title = @"My View Controller"; viewController

Swift – Using popViewController and passing data to the ViewController you're returning to

北战南征 提交于 2019-12-19 06:42:05
问题 I have an optional bool variable called showSettings on my first view controller which is called ViewController , and I'm popping from SecondViewController back to ViewController . Before I pop, I want to set the bool to true. Seems wrong to instantiate another view controller since ViewController is in memory. What's the best way to do this? I'm not using storyboards, if that's important for your answer. Thanks for your help 回答1: So I figured it out, based mostly from this post – http:/

iOS 6.0 restrict auto rotation within a navigation controller?

送分小仙女□ 提交于 2019-12-19 04:15:13
问题 What else should I do? -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation { return (toInterfaceOrientation == UIInterfaceOrientationPortrait); } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -(BOOL)shouldAutoRotate { return NO; } My viewController still rotates. It is embedded in a navigation stack. If I subclass UINavigationController, and implement the same portrait-only templates there, and I embed my