uinavigationbar

UIButton as UINavigationbar button

孤街浪徒 提交于 2019-11-30 05:20:54
I have a Tab bar application. and in one of the tab bars I have a navigation contorller. Im trying to set a UIButton with an image as the right button the navigation bar. UIButton *refreshButton = [[UIButton alloc] init]; [refreshButton setImage:[UIImage imageNamed:@"refresh_icon.png"] forState:UIControlStateNormal]; [refreshButton addTarget:self action:@selector(refreshSection) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithCustomView:refreshButton]; //[rightButton setImage:[UIImage imageNamed:@"refresh_icon.png"]]; << DOESN'T

The correct way to set a light status bar text color in iOS 7 based on different ViewControllers

∥☆過路亽.° 提交于 2019-11-30 04:57:10
I need to let a specific ViewController embedded in an UINavigationController to have light status bar text color (but other ViewController s to behave differently). I am aware of at least 3 methods, none of which however work in my case. How to change Status Bar text color in iOS 7 , the method is primarily: Set the UIViewControllerBasedStatusBarAppearance to YES in the plist In viewDidLoad do a [self setNeedsStatusBarAppearanceUpdate]; Add the following method: - (UIStatusBarStyle)preferredStatusBarStyle{ return UIStatusBarStyleLightContent; } Running on iOS 7.0.3, this method does not work

Move UINavigationController's toolbar to the top to lie underneath navigation bar

旧时模样 提交于 2019-11-30 04:52:20
问题 When you create a UINavigationController , you can reveal its default hidden UIToolbar via setToolbarHidden:animated: (or by checking Shows Toolbar in Interface Builder). This causes a toolbar to appear at the bottom of the screen, and this toolbar persists between pushing and popping of view controllers on the navigation stack. That is exactly what I need, except I need the toolbar to be located at the top of the screen. It appears that's exactly what Apple has done with the iTunes app: How

Changing Navigation Controller colour swift

故事扮演 提交于 2019-11-30 04:49:39
问题 I want to change the navigation bar tint controller colour to the colour: R: 73, G: 155, B: 255, A: 0.7 Till now, I have only been able to change it to the colours in the system. Here is an example in the Delegate: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { UINavigationBar.appearance().barTintColor = UIColor.blueColor() UINavigationBar.appearance().tintColor = UIColor.whiteColor() return true } Also, I would like to be

How to make navigation bar transparent in iOS 7? [duplicate]

我们两清 提交于 2019-11-30 04:48:43
This question already has an answer here: How to draw a transparent UIToolbar or UINavigationBar in iOS7 5 answers Is there a way to make the bar of a navigation controller totally transparent? What i've tried: [self.navigationController.navigationBar setBackgroundColor:[UIColor clearColor]]; [self.navigationController.navigationBar setBarTintColor:[UIColor clearColor]]; [self.navigationController.navigationBar setAlpha:0.0]; but the bar's appearance does not change, and stays white translucent. I'm trying to get visible the bar items, but not the bar itself. Can someone point me in the right

How can I change the background image for my NavigationBar on a per page basis?

末鹿安然 提交于 2019-11-30 04:07:32
I've been looking around for a way to change the background image of my NavigationBar and control the appearance of my NavigationBar as the user navigates the app. I understand that the accepted approach for changing the background image is : @implementation UINavigationBar (UINavigationBarCategory) - (void)drawRect:(CGRect)rect { UIImage *image = [UIImage imageNamed: @"navbar.png"]; [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; } @end However, that changes the appearance of the NavigationBar throughout the whole app. How can I change the background image

UIStatusBar as in Facebook new iOS7 application

我的梦境 提交于 2019-11-30 04:03:59
I have an app with side bar menu, kinda like Facebook side bar menu. I'm using this class called SWRevealViewController and it's working great. Now since iOS7 has came out, I just can't figure out how to adjust my Status and Navigation Bar to be like in Facebook app. As you can see, in the Facebook app, when the user slides the screen and open's the menu, the status bar turn from the Navigation Bar blue color to black with Fade animation. In my app, the user slides the screen to open the menu and the status bar with the blue color (that is blue because of that view NavigationBar) won't fade

Bar Button Item not correctly aligned

∥☆過路亽.° 提交于 2019-11-30 03:55:31
问题 I have an issue with my navigation bar, the UIBarButtonItem is not correctly vertically aligned. I don't know why because I'm using a simple UIBarButtonItem and not a custom view. See my code below and thanks for your help! UIBarButtonItem *newGameItem = [[UIBarButtonItem alloc] initWithTitle:@"New Game" style:UIBarButtonItemStyleDone target:self action:@selector(newGame)]; self.navigationItem.rightBarButtonItem = newGameItem; 回答1: Actually there are couple ways to align the bar buttons. Try

UINavigationBar and new iOS 5+ appearance API - how to supply two background images?

谁说胖子不能爱 提交于 2019-11-30 03:49:06
问题 I want to exploit the new iOS 5 appearance API to supply custom background images to all UINavigationBar instances in my app. To do this, it's as simple as this: [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"whatever.png"] forBarMetrics:UIBarMetricsDefault]; However, for each instance, I want to provide a different image depending on the value of the translucent property, e.g. // For UINavigationBar instances where translucent returns YES: [[UINavigationBar appearance

How to add a navigation controller programmatically in code but not as initial view controller

*爱你&永不变心* 提交于 2019-11-30 03:41:51
I am relatively new to swift and iOS and can't find an answer or any help for my problem that works. I want to create a navigation controller view when I click on a button in my previous view. My previous view is an on-boarding with a button on the last page. I successfully connected the button to my next view but I am not able to make the view act like a navigation controller. For example, when a navigation bar is displayed, I am not able to add navigation items to it. Is there a way to set the new view I create by clicking my button in the first view to be the root controller for my