uinavigationbar

How to change the border color below the navigation bar?

风格不统一 提交于 2019-11-30 12:44:00
问题 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 回答1: 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]

iOS: Navigation bar with images for buttons

一曲冷凌霜 提交于 2019-11-30 12:38:32
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? 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; Here the Code, Just call below Methods From viewDidLoad method - (void)addCustomButtonOnNavBar {

iOS 7 UINavigationBar - UIView layout issue

回眸只為那壹抹淺笑 提交于 2019-11-30 11:55:52
问题 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? 回答1: Try

Add another button next to the “back” button on the left of a UINavigationBar

二次信任 提交于 2019-11-30 11:48:32
I've tried this for hours but I still cannot solve it. When using UINavigationController and push a new view controller on top, I got a free "back" button on the left of the navigation bar. I want another button just next to it (to show a popover menu). I wonder what is the correct way to do that. Or I have to hide the free back button and make the same one by myself? If that's the case, I also need to pop the current view controller when pressing my own back button, right? Thanks for your help. As stated by steipete in the comment to the question, this is possible starting from iOS 5. You can

UINavigationBar TitleView with subtitle

我是研究僧i 提交于 2019-11-30 11:36:52
I want a titleView inside my UINavigationBar which has two lines of text instead of only one My current implementiation works well when I have a "Back"-Button and an "Edit" Button because it looks nearly centered. The problem is when I only have one of the Buttons. It looks really weird and wrong because the view centers itself on the available space. UINavigationBar with left and right Button UINavigationBar with only one Button This is my current implementation: CGRect frame = self.navigationController.navigationBar.frame; UIView *twoLineTitleView = [[UIView alloc] initWithFrame:CGRectMake

Add a navigation bar to a view without a navigation controller

冷暖自知 提交于 2019-11-30 11:05:32
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? 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 suggested) - -(void) viewWillAppear:(BOOL)animated { UINavigationBar *myNav = [[UINavigationBar alloc

How do i change navigationBar font in Swift?

喜你入骨 提交于 2019-11-30 10:47:12
问题 How do I change the NavigationBar font in Swift? This is what I have tried so far, but receiving an error (I have correctly implemented CaviarDreams to the project): self.navigationController.navigationBar.titleTextAttributes = NSFontAttributeName[UIFont .fontWithName(CaviarDreams.ttf, size: 20)] Error says: Use of unresolved identifier 'CaviarDreams Sorry if the question is extremely bad. 回答1: Try this: self.navigationController.navigationBar.titleTextAttributes = [ NSFontAttributeName:

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

前提是你 提交于 2019-11-30 10:39:13
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? 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.delegate = self; } Now comes the important part: implement in the delegate this method: - (UIBarPosition

How to add image in UINavigationBar in IPhone app

牧云@^-^@ 提交于 2019-11-30 10:34:44
问题 In my app, i want to add image(logo) in Navigation bar. I am working on XCode 4.2 and iOS 5. I know UINavigationBar , UIToolBar has been changed in iOS 5. So iOS 4.2 UINavigationBar code won't work in iOS 5. I want to support display image in UINavigationBar in both 4.2 and 5 version. I want to be display image in UINavigationBar like as in below screenshot. Please help in this regards and if there is any sample code means its very helpful to me. Thanks!!! 回答1: One way to do this is to use

Translucent Status Bar with No Navigation Bar

China☆狼群 提交于 2019-11-30 09:52:49
Goal: To have a table view scroll so that it shows semitransparent under the status bar while not displaying a navigation bar. Right now, I have my tableView set to the top anchor (so technically underneath the status bar). This sets the status bar to a solid looking color as you scroll up on the table view. I've set the navigationAppearance's barTintColor and translucent to YES with no luck. Any ideas? The view is instantiated in a storyboard Joe Your question is hard to guess without any code .I believe you trying to achieve a translucent status bar when tableview content scroll like you