uinavigationbar

iOS 7: modal view controller status bar is wrong color but normal view controllers are correct

妖精的绣舞 提交于 2019-12-03 01:30:26
I have an issue in iOS7 where a normal UINavigationController pushed view controller has the correct status bar text color for the UINavigationController navbar color (which is a light gray, almost white so the status bar text is black). However, when a "modal" view controller is presented using -presentViewController:animated:completion: , the status bar text color is changed to white and is very hard to see given the color of the navbar. Navbar color is always the same across the whole app and does not change for each view controller. This happens on every -presentViewController call. "View

How to add multiple UIBarButtonItems on right side of Navigation Bar?

独自空忆成欢 提交于 2019-12-03 01:17:57
问题 I would like to have more than a single UIBarButtonItem on the right side of my UINavigationBar . How can I achieve this? An example of what I am trying are shown below - you can notice that the top right has more than one button. 回答1: Use this in swift: override func viewDidLoad() { super.viewDidLoad() let editImage = UIImage(named: "plus")! let searchImage = UIImage(named: "search")! let editButton = UIBarButtonItem(image: editImage, style: .Plain, target: self, action: "didTapEditButton:")

Add space from the top for navigation title

我是研究僧i 提交于 2019-12-03 00:37:00
问题 Want to give additional space from the top for navigation title shopping list. How can I do it? Dont see a option to do it in the properties of navigation item in the story board. Its close to the date, battery icon in the top of the app. Attached the screenshot. Tried the below code its not working using swift2 override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. navigationController?.navigationBar

UINavigationBar change Tint color with animation

对着背影说爱祢 提交于 2019-12-03 00:24:53
Is it possible to change the tint with animation for a smoother effect? This doesn't work for me: [UIView beginAnimations:nil context:nil]; [self.navigationController.navigationBar setTintColor:[UIColor greenColor]]; [UIView commitAnimations]; I a not sure if it is even possible using native apple components as I guess they will be using CG to generate the gradient ... just want to find out before I'll start building my own solution ... Cheers guys :) steipete You wouldn't believe the length I went through to actually make that possible; it annoyed me to no end that this isn't a stock iOS

Persistent rightBarButtonItem Property of UINavigationItem

点点圈 提交于 2019-12-03 00:23:12
This may be a stupid question, but is it possible to keep a right UIBarButtonItem across multiple views managed by a UINavigationController ? I have a progression of views that often share the same right UIBarButtonItem , but when I push a new view to my UINavigationController , I have to redefine the button every time, even if it hasn't changed. Mostly, the noticeable transitional animation from one view to the next is what bothers me because the exact same button briefly fades out then back in, which is unnecessary since there is no actual visual change. Should I consider just adding a

Adding UIToolbar with two UIBarButtonItem to a UINavigationBar: poor UIToolbar and what about iPhone 4

萝らか妹 提交于 2019-12-03 00:20:44
I'm following the second tip from here . In this tip two UIBarButtonItems are put together in a UIToolbar. Finally, the UIToolbar is added to the UINavigationBar. Now to my problems: 1) A white line is on top of the UIToolbar. If I increase the size of the UIToolbar, the gradient is wrong. I'm using the following size for the UIToolbar: UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 90, 44.01)]; How can I get rid of the white line? See here: The problem is that there is a white instead of a grey line. If it would be grey, everything would be perfect. 2) What about the

setBackgroundImage forBarMetrics image size?

旧城冷巷雨未停 提交于 2019-12-03 00:18:50
I am fairly new in iOS programming and I am creating my first app. I have been trying to use the following code to change the navigation bar background image (this is using the new iOS 5 method): [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"gradientBackgroundPlain.png"] forBarMetrics: UIBarMetricsDefault]; It works fine, but my image is 640 x 88 and it looks too big for the bar. It's like the system doesn't want to scale it, or do I need to do it manually? If I scale the image and create a smaller one it looks pixelated in the retina display. Any thoughts

Swift exclamation mark before a text

ⅰ亾dé卋堺 提交于 2019-12-02 23:33:13
问题 This tutorial I am currently working on says I have to disable the Save Button until the text field has some value in it. Here is the code: saveButton.isEnabled = !text.isEmpty Does the exclamation mark before text.isEmpty mean that the save button is enabled is the text is not empty same way that != mean not equal to? I know exclamation mark means force unwrap, but I thought you put the exclamation mark after the text. BTW(I have tested it and it works as the tutorial says so) 回答1: The

Showing a UIProgressView inside or on top of a UINavigationController's UINavigationBar

淺唱寂寞╮ 提交于 2019-12-02 22:51:37
I want to have an UIProgressView to show a progress on the bottom of a navigation bar (just like when sending an iMessage or text message in iOS 7). But I need this consistently on every table view view of my navigation controller. So for me it was clear: I have to add this to the UINavigationController. But the problem is, it's not possible to add an UIProgressView to the UINavigationController. So I tried out two things: 1st I tried to add it to UINavigationController's view programmatically. But the problem was to position the UIProgressView and to make it look good when changing device

Can't Change Height of NavigationBar in NavigationController (it's much wider than normal)

冷暖自知 提交于 2019-12-02 22:50:14
问题 I have a NavigationController extending from a master TabBarController and extending a ViewController and VC extends to 2x TableView (so, TabBar -> NavigationController -> ViewController -> 2xTableView[with .xib] ). I had to add Navigation Bar to the Navigation Controller to make it work in the viewController, thus works in both tableviews (because I use Instagram-style swipe by using PageMenu). Now, I can see the navigation bar. (Please note that I had to uncheck Translucent on navigation