uinavigationcontroller

shouldAutorotate not working with navigation controllar swift 2

余生颓废 提交于 2019-12-24 00:44:04
问题 my app uses several libraryies. Bassically KYDrawerController. I want my App to use only potraite Orientation but for one ViewControllar i need both landscape and Potrait. I have search about allmost every solution on the internet. every solution was to subclass the NavigationControllar and Override ShouldAutoRotate method. but non of them worked for me. and here is the closer View of the entire StoryBoard the gray color View is the KYDrawerControllar view which is an libry uses to work as

Modal UINavigationController hides although not dismisses

前提是你 提交于 2019-12-24 00:27:28
问题 Okay, so I'm building an universal iOS app with an initial login view (view controller named LoginVC), just a plain simple UIViewController. If the login is successful the app segues to an navigation controller (MainNavigationVC). I created this segue through the storyboard gui of XCode, so no programmatic creation of the nav controller is done. The nav controller is presented modally in fullscreen, so the rest of the app is run atop the login view, with this nav controller as the centerpiece

Make custom back button's clickable area smaller in Navigation controller

北慕城南 提交于 2019-12-23 22:52:52
问题 I've created a custom back button with the code below, however the clickable area is very big and goes well beyond the icon itself. Does anyone know how to set the clickable area, or make it the same size as the image? Thanks UIImage *buttonImage = [UIImage imageNamed:@"prefs"]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setImage:buttonImage forState:UIControlStateNormal]; button.frame = CGRectMake(0, 0, buttonImage.size.width, buttonImage.size.height); [button

swift ios trying to change color of status bar on certain VC's

♀尐吖头ヾ 提交于 2019-12-23 22:13:38
问题 In my app I have 4 ViewController and in two of them I am changing the status bar from white to black like this: override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.Default } override func viewWillDisappear(animated: Bool) { super.viewWillDisappear(animated) UIApplication.sharedApplication().statusBarStyle = .LightContent } The problem is if I switch between two ViewController that both have the code

pushing UIViewController without Navigation Controller

本小妞迷上赌 提交于 2019-12-23 21:15:49
问题 I was using that method for pushing another UIViewController in if condition : initViewController *MW = [initViewController alloc]; MW = [self.storyboard instantiateViewControllerWithIdentifier:@"init"]; [self.navigationController pushViewController:MW animated:YES]; Now i've changed my architecture and i just removed my Navigation controller. That's why , these steps will not help me any longer due to no NavigationController exist. Now how can i push another ViewController without pressing

How to go back in the navigation stack?

丶灬走出姿态 提交于 2019-12-23 18:06:32
问题 My app has 7 subsequent view controllers: VC1 - VC7 In my navigation bar I have a back button with to actions: tapped and longPressed. When the backButton gets pressed long in any VC, the app should go to VC2 and present it as if the user went from VC1 to VC2, specifically: with the right back button tapped action. This is my code for UILongPressGestureRecognizer: func longPressAction(gestureRecognizer: UIGestureRecognizer) { if (gestureRecognizer.state == UIGestureRecognizerState.Ended) {

How to call viewWillDisappear method in Tabbar Application having navigations also

折月煮酒 提交于 2019-12-23 12:39:16
问题 I have created 5 Tabs in my application. In Tab1 i have UITableView . On didSelectRowAtIndexPath i am navigating to another UIView in which I am showing my all 5 Tabs. And I also play song in that navigated view. Now when I click Back button in navigation and i again go to my original view, i am able to call viewWillDisappear (as expected and normal situation). But when I click directly another tab then viewWillDisappear is not called in the navigated View. Why this Happens?? I have just

Why does using setViewControllers remove everything from the UINavigationController's nav bar?

◇◆丶佛笑我妖孽 提交于 2019-12-23 10:44:34
问题 Here's the issue. I use the following code in a UINavigationController to swap the rootViewController . I need to be able to swap the rootViewController between a number of different screens and allow the user to drill down from each screen (which is obviously why I need the Nav Controller): SomeViewController *tmp = [[SomeViewController alloc] initWithNibName:@"SomeViewController" bundle:nil]; NSArray * viewControllers = [self viewControllers]; NSArray * newViewControllers = [NSArray

Why does using setViewControllers remove everything from the UINavigationController's nav bar?

我的梦境 提交于 2019-12-23 10:44:15
问题 Here's the issue. I use the following code in a UINavigationController to swap the rootViewController . I need to be able to swap the rootViewController between a number of different screens and allow the user to drill down from each screen (which is obviously why I need the Nav Controller): SomeViewController *tmp = [[SomeViewController alloc] initWithNibName:@"SomeViewController" bundle:nil]; NSArray * viewControllers = [self viewControllers]; NSArray * newViewControllers = [NSArray

UINavigationBar right button not showing up

安稳与你 提交于 2019-12-23 10:17:15
问题 I am using the following function via a notification to load a right button on my UINavigationBar, and even though I can trace out the button and verify it is allocated, it does not show up...any ideas? EDIT 4/6/2011, 2:42PM So, something interesting...the width always reports as 0.0... - (void)showRightBarButton:(id)sender { NSLog(@"Showing button"); UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(showPI:)];