uinavigationbar

iOS 7 : Disable UINavigationBar Translucency For Entire App

你。 提交于 2019-11-28 21:00:47
Is there a way to disable UINavigationBar Translucency for an entire application? I'm aware that using [self.navigationController.navigationBar setTranslucent:NO] can fix this issue for a single controller, but I have a lot of UINavigationBars in my application and this is a pretty tedious solution. I've tried [[UINavigationBar appearance] setTranslucent:NO] , but that functionality is surprisingly not supported. Doing that results in Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** Illegal property type, c for appearance setter,

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

我怕爱的太早我们不能终老 提交于 2019-11-28 20:58:08
问题 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:

Instagram-like navigation bar (iOS 7)

好久不见. 提交于 2019-11-28 20:40:50
问题 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? 回答1: I found THE solution, just like you

UINavigationBar BarButtonItem with Plain Style

拜拜、爱过 提交于 2019-11-28 20:29:04
i got the following code: - (id)init { if (self = [super init]) { self.title = @"please wait"; UIBarButtonItem *favorite = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"star.png"] style:UIBarButtonItemStylePlain target:self action:@selector(buttonFavoriteClicked:)]; self.navigationItem.rightBarButtonItem = favorite; } return self; } but my button looks still like a Button with UIBarButtonItemStyleBordered is there a way to set a button with plain style at this position? Create a UIButton in interface builder, make it look like exactly what you want. Create an outlet for in in

UINavigationBar gradient details

吃可爱长大的小学妹 提交于 2019-11-28 19:58:33
I'm trying to recreate the look of a UINavigationBar. The background of the bar is drawn using a gradient, but it's unclear exactly what the default colors and points are in it. Has anyone done anything in this area? From one of my projects. Adjust the colors to your liking. It also can show a background image if you want (imageReady), else it draws the navbar like Apple's // #Lighter r,g,b,a #Darker r,g,b,a #define MAIN_COLOR_COMPONENTS { 0.153, 0.306, 0.553, 1.0, 0.122, 0.247, 0.482, 1.0 } #define LIGHT_COLOR_COMPONENTS { 0.478, 0.573, 0.725, 1.0, 0.216, 0.357, 0.584, 1.0 } @implementation

Change color of translucent black UINavigationBar

我与影子孤独终老i 提交于 2019-11-28 19:47:55
问题 I stumbled upon this many times, never found a solution. A UINavigationController's navigationBar can be set to black translucent like: self.navigationController.navigationBar.barStyle=UIBarStyleBlackTranslucent; Also, there is a translucent property in UINavigationBar, the docs say: When YES, the navigation bar is drawn with partial opacity, regardless of the bar style. The amount of opacity is fixed and cannot be changed. It is permissible to set the value of this property when the

Placing a custom view based UIBarButtonItem in the navigation bar without default horizontal padding

China☆狼群 提交于 2019-11-28 19:46:44
问题 How do I remove the horizontal padding to the left and right of custom left and right UINavigationBar items? There seems to be ~ 10 points of padding that iOS sets by default. I'm customizing left and right navigation bar buttons (I have given up on trying to set my own backButtonItem, so I'm just using the leftBarButtonItem). In either case (left or right), pressing these custom buttons indicates that Apple seems to preserve some padding to the left of the leftBarButtonItem, and to the right

Set the title of Navigation Bar created in Interface Builder

自古美人都是妖i 提交于 2019-11-28 19:32:36
问题 I have a modal view controller whose view comes from a XIB. I want it to have the same look and feel as the rest of my navigation based app, but it's not a view that's pushed to the navigation stack, it's presented modally. I dragged a UINavigationBar in and made it an outlet, but it doesn't have a title property to set. I have two fields that can bring up this modal view, and I want the title set differently depending on which one creates the modal view. 回答1: UINavigationBar 's manage a

Navigation stack becomes unusable after canceling iOS 7 back swipe gesture

吃可爱长大的小学妹 提交于 2019-11-28 18:40:50
I am running into an issue where my navigation controller becomes unusable after initiating then canceling the new iOS 7 back swipe gesture. Some relevant information: My app has a home page with various activity pages. The home page hides the navigation bar in viewWillAppear The home page un-hides the navigation bar in viewWillDisappear -(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // Let's hide the navbar when we show the home view [self.navigationController setNavigationBarHidden:YES]; … } -(void) viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]

iOS 11 navigationItem.titleView Width Not Set

让人想犯罪 __ 提交于 2019-11-28 18:31:32
Seeing a behavior on iOS11 with a navigationItem.titleView where the width of the titleView is not the full width of the screen. I have a custom view that I set as the titleView. Previous to iOS11 the view would fill the navigation bar area. But iOS 11 it is not resizing to fill the width of the screen. I've tried setting the frame of the view before setting titleView but no luck. I've tried to force the titleViews superview to layout constraints as well but no luck. Screenshots attached: iOS10: iOS11: Anyone else experience this? gngrwzrd I figured it out. I had to override the