uinavigationbar

How to change the border color below the navigation bar?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 03:29:27
Can anyone advise me on how the border below the navigation bar can be changed? I would like to change it from the current black light to a softer color. Appreciate any help here I do not think there is a method to change the border color of the navigation color, other than the tintColor property of the UINavigationBar . I would suggest that you create a UIView of that border size and place it below the navigation bar / add it as a subView . UIView *navBorder = [[UIView alloc] initWithFrame:CGRectMake(0,navigationBar.frame.size.height-1,navigationBar.frame.size.width, 1)]; // Change the frame

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

耗尽温柔 提交于 2019-11-30 02:06:34
I want to change the color of back button of a navigation bar to make it look like this 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]]; The first line of jacob's answer didn't work for me because the backBarButtonItem was NULL. It is NULL because it's been created later automatically when switching to an other

iOS: navigation bar's titleView doesn't resize correctly when phone rotates

佐手、 提交于 2019-11-30 02:05:21
I'm writing an iPhone app that (like most apps) supports auto-rotation: You rotate your phone, and its views rotate and resize appropriately. But I am assigning a custom view to navigationItem.titleView (the title area of the navigation bar), and I can't get that view to resize correctly when the phone rotates. I know what you're thinking, "Just set its autoresizingMask to UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight ," but it's not that simple. Of course, if I don't set my view's autoresizingMask , then my view doesn't resize; and I want it to resize. The problem is, if

How can I get a full-sized UINavigationBar titleView

廉价感情. 提交于 2019-11-30 01:51:28
I am trying to add a custom control as the titleView in a UINavigationBar. When I do so, despite setting the frame and the properties that would normally assume full width, I get this: The bright blue can be ignored as it is where I am hiding my custom control. The issue is the narrow strips of navbar at the ends of the bar. How can I get rid of these so my customview will stretch 100%? CGRect frame = CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y, self.view.width, kDefaultBarHeight); UANavBarControlView *control = [[[UANavBarControlView alloc] initWithFrame:frame] autorelease

iOS 7 UINavigationBar - UIView layout issue

你说的曾经没有我的故事 提交于 2019-11-30 01:41:13
Have a problem with layouts. Here is how it looks right on iOS6: Here is how looks on iOS7: But it's ok. And like described in Apple's iOS7 TransitionGuide I wrote one more stroke in - (void)viewDidLoad self.edgesForExtendedLayout = UIRectEdgeNone; And it now it's look like this: Any suggestions? What can be wrong with my layouts? I want solid blue UINavigationBar. And have no idea, why the top of this is transparent. Have any ideas, why it looks so strange? How can I fix this? null Try navigationBar.translucent = NO; It is YES by default. From the UINavigationBar documentation: New behavior

Change title color of navigation bar in MFMailComposeViewController in iOS 12 not working

情到浓时终转凉″ 提交于 2019-11-30 01:28:18
How can I change the title color of UINavigationBar in MFMailComposeViewController in iOS 12 ? This is what I am doing: import MessageUI extension MFMailComposeViewController { open override func viewDidLoad() { super.viewDidLoad() navigationBar.isTranslucent = false navigationBar.isOpaque = false navigationBar.barTintColor = .white navigationBar.tintColor = .white navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] } } In iOS 10 works: In iOS 11 works: In iOS 12 is not working: I tried all the way to change the title color, however it doesn't work Before

Presenting a Modal View Controller hides the Navigation Bar

被刻印的时光 ゝ 提交于 2019-11-30 00:57:17
问题 I have a navigation based app with a navigation bar, but there are a few instances where instead of pushing a view controller onto the stack, I need to present the view controller modally. The problem is that when I dismiss the modal view controller, everything functions as expected except that the navigation bar is hidden and the (parent view) has been resized, which is the expected behavior according to the docs. So I figured I could simply call a built-in method to unhide the navigation

Instagram-like navigation bar (iOS 7)

↘锁芯ラ 提交于 2019-11-29 23:24:24
I'm trying to make same affect, as instagram has in their header. How can I do this? I tried a lot of solutions. Best - https://github.com/andreamazz/AMScrollingNavbar But it has one big problem - it's moving bar using uipangesturerecognizer. It's bad for me, because I want to show bar, if table is at the top. I tried to change work of this control to scroll view delegate, but found a lot of problems with it, have you any ideas, how they made this? I found THE solution, just like you said - you have to mess around with the scroll view delegate a little bit, but after some 2 hours I had it all

Transparent UINavigationBar in Swift

依然范特西╮ 提交于 2019-11-29 22:51:48
I am trying to make my UINavigationBar in UINavigationController transparent. I created a subclass of UINavigationController and liked it to a scene in my storyboard file. Here's a piece of my subclass: override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. let size = self.navigationBar.frame.size self.navigationBar.setBackgroundImage(imageWithColor(UIColor.blackColor(), size: size, alpha: 0.2), forBarMetrics: UIBarMetrics.Default) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be

Change UINavigationBar font properties?

点点圈 提交于 2019-11-29 22:50:58
I have an UINavigationBar added to my UIViewController view. I want to change the fonts properties. Note that I want to change a UINavigationBar not controller. In my app where I use UINavigationController I use self.navigationItem.titleView = label; to display the custom label. How can I accomplish to have a custom title in my UINavigationBar? P.S I use this to set the title text self.navBar.topItem.title = @"Information"; of my UINavigationBar. Sandeep From iOS 5 onwards we have to set title text color and font of navigation bar using titleTextAttribute Dictionary(predefined dictionary in