uinavigationbar

How to Edit Empty Spaces of Left, Right UIBarButtonItem in UINavigationBar [iOS 7]

一曲冷凌霜 提交于 2019-11-26 17:04:16
I was using iOS 6.1 earlier, but now I have moved to iOS 7. Along with other problems, I have observed that in my navigation bar, the left space of left bar button item and right empty space of the right button bar item are quite more in IOS 7 than in iOS 6. I need to know is there a way I can reduce empty spaces of left, right bar button items in navigation bar?? Thanks in advance. Adnan Aftab I was also facing this problem. I also have feelings that in iOS 7 there is more space. And I figured out that this is about 10 points more. I usually use negative spaces when I want for

transparent navigation bar ios

元气小坏坏 提交于 2019-11-26 17:01:10
I'm creating an app and i've browsed on the internet and i'm wondering how they make this transparent navigationBar like this: I've added following like in my appdelegate: UINavigationBar.appearance().translucent = true but this just makes it look like following: How can i make the navigationBar transparent like first image Vidhyanand You can apply Navigation Bar Image like below for Translucent. Objective-C: [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; //UIImageNamed:@"transparent.png" self.navigationController.navigationBar

setting image for UIBarButtonItem - image stretched

风格不统一 提交于 2019-11-26 16:49:12
问题 When I try to use UIBarButtonItem's "initWithImage" to initialize a navigation bar custom image, it comes out washed-up and stretched against a black navigation bar. This is how I create it: UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"gear.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(showSetting:)]; Here is what it looks like: Any idea if it's a problem with the image? I got it from a set of icons I bought. 回答1: The displayed

NavigationBar delay updating barTintColor iOS10

微笑、不失礼 提交于 2019-11-26 16:43:15
Context: Let's say we have one NavigationController and 2 viewControllers. ViewControllerA has a blue navigationBar, while ViewControllerB has a green one. I set them up like so : override func viewWillAppear(_ animated: Bool) { self.navigationController?.navigationBar.barTintColor = UIColor.blue // Green if ViewController B } It works well when I got from A to B, but when I return, the navigationBar teint is updated after. Like if it was set up in the viewDidAppear . Expected: The navigation bar should have its navigation bar color updated without delay. Solutions tried: I've seen this SO

how to hide navigationbar when i push from navigation controller?

和自甴很熟 提交于 2019-11-26 16:04:56
问题 how to hide top bar in UIViewcontroller when i push from navigation controller using pushViewController ? any help please? 回答1: Put this code in the view controller you want to hide the navigation bar for. - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.navigationController setNavigationBarHidden:YES animated:animated]; } And you may also want to stick this in there, depending on your needs: - (void) viewWillDisappear:(BOOL)animated { [super viewWillDisappear

IOS 7 Navigation Bar text and arrow color

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 15:34:22
I want to set background for Navigation Bar to be black and all colors inside it to be white . So, I used this code : [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], NSForegroundColorAttributeName, [UIColor whiteColor], NSForegroundColorAttributeName, [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], NSForegroundColorAttributeName, [UIFont fontWithName:@"Arial-Bold" size:0.0], NSFontAttributeName, nil]]; But back button text color , arrow and bar button have still default blue color . How to change those colors like on

Warning frame for “Navigation bar” will be different at run time appears in Xcode 8 Swift 3

给你一囗甜甜゛ 提交于 2019-11-26 15:15:58
问题 Before I've upgraded to Xcode 8 I haven't seen this error in such case. I have different Navigation Controllers. For all of them I see an error Frame for "Navigation bar" will be different at the run time. Navigation bar "Expected: width=384, Actual: width=375 . In reality these Navigation Controllers doesn't have Navigation bar . Navigation bar exists for subviews. Anyway I could solve it by tick and untick the checkbox Shows navigation bar in Attributes inspector . But unfortunately every

How to add a button to UINavigationBar?

╄→尐↘猪︶ㄣ 提交于 2019-11-26 15:10:35
问题 How to add a button to UINavigationBar programmatically? 回答1: Sample code to set the rightbutton on a NavigationBar . UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:nil action:nil]; UINavigationItem *item = [[UINavigationItem alloc] initWithTitle:@"Title"]; item.rightBarButtonItem = rightButton; item.hidesBackButton = YES; [bar pushNavigationItem:item animated:NO]; But normally you would have a NavigationController ,

Change iPhone navigation bar's height

﹥>﹥吖頭↗ 提交于 2019-11-26 13:54:40
问题 My client can't read iPhone's default fonts, the size is too small. I have an application with a navigation bar and I need to make everything in it bigger, for example, the font's size. IB doesn't seem to allow this... any help? Many thanks! 回答1: Update: today (2012) there is a much bigger tendency towards custom UIs, so I would say the answer below is way too harsh. There is still no supported way of customizing height, though, but you can certainly derive from UINavigationBar and override

Dark shadow on navigation bar during segue transition after upgrading to Xcode 5.1 and iOS 7.1

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 12:51:40
问题 When I am navigating back & forth between parent and child controllers in a master - detail navigation controller, i see a dark shadow on the right side of navigation bar at top. It started after I upgraded to Xcode 5.1. It feels rough and distracting. How can I get rid of it? 回答1: self.navigationController.view.backgroundColor = [UIColor whiteColor]; I solved this problem by setting the background color of the navigation controller's view. 回答2: self.navigationController.navigationBar