uinavigationbar

iOS: Navigation bar with images for buttons

此生再无相见时 提交于 2019-12-18 15:47:44
问题 I would like to create a NavigationBar with images as buttons on the right side of the NavigationBar. Something like below Snapshot How can I achieve this? 回答1: Hope This Helps viewController.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yourimage.png"]]; UIBarButtonItem * item = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yourimage2.jpg"]]]; viewController.navigationItem.rightBarButtonItem = item;

Modal status bar and navigation bar text colors from UIActivityViewControllers in iOS 7

安稳与你 提交于 2019-12-18 14:49:32
问题 When I'm using a UIActivityViewController , after the user chooses an activity (such as Mail or Message), I can not change the text color for the status bar nor the text/tint color of the Cancel and Send navigation bar buttons. For the bar buttons, in the AppDelegate I've tried using: [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; And nothing happens. However I am able to set the navigation bar title with this: [[UINavigationBar appearance] setTitleTextAttributes:

Add a navigation bar to a view without a navigation controller

不想你离开。 提交于 2019-12-18 14:39:07
问题 I have a side menu that slides out to display a table view and from there I have segues that use the reveal view controller. The segue has to connect directly to the view controller; I can't use a navigation controller. How do I add a navigation bar with a bar button item without a navigation controller? 回答1: While there are several smart ways to answer your question. I just solved it programmatically and wrote the following code in my viewWillAppear (note - viewDidLoad is also okay, but not

iOS7 Xcode utility app - UINavigationBar on Flipsideviewcontroller not spaced properly?

会有一股神秘感。 提交于 2019-12-18 13:50:52
问题 I have this issue, where as standard the flipsideviewcontroller UINavigationBar looks like this: Anybody have any ideas on how to move the UINavigationBar either down, or to stop the ugliness of it all? 回答1: It's tricky. :) You need to set a delegate for the UINavigationBar - this will probably be the FlipsideViewController. You can do this in the storyboard, or in code - for example, if you have an outlet to the navigation bar: -(void)viewDidLoad { [super viewDidLoad]; self.navigationBar

New UINavigationBar appearance in detail pane of UISplitViewController in iOS 13

回眸只為那壹抹淺笑 提交于 2019-12-18 12:57:10
问题 Under iOS 13, if you setup a scrollable root view controller (such as a UITableViewController) in a navigation controller and then put that navigation controller in the detail pane of a UISplitViewController, then the nav bar's background isn't visible when the scrollable content is at the top. You can see this by creating a new iOS project based on the Master/Detail template. Then modify the storyboard to use a UITableViewController inside the detail pane's nav controller. Put the device

Custom background for UINavigationBar problems

有些话、适合烂在心里 提交于 2019-12-18 12:03:40
问题 I've managed to add a custom background to my navigation bar by using: UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"UINavigationBar.png"]]; [myViewController.navigationBar insertSubview:iv atIndex:0]; [iv release]; This works fine and I can see the title and buttons okay. However, when I drill down one level and then go back to the root, the buttons are hidden, but the title is still visible. It appears the navigation bar image is covering the button items. I'm

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

不想你离开。 提交于 2019-12-18 11:26:16
问题 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

IOS 5 How to change the color of back button in a navigation bar?

安稳与你 提交于 2019-12-18 11:19:34
问题 I want to change the color of back button of a navigation bar to make it look like this 回答1: Set the backBarButtonItem 's tintColor : self.navigationItem.backBarButtonItem.tintColor = [UIColor redColor]; TIP : If you want this to be applied to all UIBarButtonItem instances in your application by default, then you can use the new UIAppearance API to do just that: [[UIBarButtonItem appearance] setTintColor:[UIColor redColor]]; 回答2: The first line of jacob's answer didn't work for me because the

IOS 5 How to change the color of back button in a navigation bar?

匆匆过客 提交于 2019-12-18 11:18:25
问题 I want to change the color of back button of a navigation bar to make it look like this 回答1: Set the backBarButtonItem 's tintColor : self.navigationItem.backBarButtonItem.tintColor = [UIColor redColor]; TIP : If you want this to be applied to all UIBarButtonItem instances in your application by default, then you can use the new UIAppearance API to do just that: [[UIBarButtonItem appearance] setTintColor:[UIColor redColor]]; 回答2: The first line of jacob's answer didn't work for me because the

Changing the animation for UINavigationController NavigationBar

混江龙づ霸主 提交于 2019-12-18 11:17:53
问题 Right now when I use [self.navigationController setNavigationBarHidden:NO animated:YES]; The navigation bar flies in from right to left, is there a way to drop it down top to bottom? 回答1: Give this a go: CATransition *transition = [CATransition animation]; transition.duration = kAnimationDuration; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromTop; transition