uinavigationbar

Setting title for UINavigation bar in iphone

一世执手 提交于 2019-12-02 02:21:50
I am adding image to navigation bar it works fine but when i want to add title self.title=@"Activity"; it does not show anything using another way i add title label also but this works fine for one view controller but on second controller i change title but it also shows prevoius title here is my code UIImage *image = [UIImage imageNamed:@"Nav.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; [self.navigationController.navigationBar addSubview:imageView]; titleLabel=[[UILabel alloc] initWithFrame:CGRectMake(50,2,250,36)]; titleLabel.text=@"Activity"; titleLabel

UINavigationBar background image with scaleAspectFill-like behavior

烂漫一生 提交于 2019-12-02 02:11:00
问题 tl;dr I'm trying to set a background image for a UINavigationBar . Is there a way to configure the navbar so that it uses scaleAspectFill -like behavior (as a UIImageView with contentMode set to scaleAspectFill )? The goal I have an image roughly fitting the navbar dimension of a landscape iPhone (64pt height, about 800pt width; the exact dimension should not matter here though), which I set with navigationBar.setBackgroundImage(img, for: .default) . The image is a blurred photo, so no need

Separate title in NavigationBar and navigation buttons

情到浓时终转凉″ 提交于 2019-12-02 02:05:57
问题 Hey, I have a stack of UIViewController s inside of a UINavigationController . Usually the title (or the NavigationItem‘s title) decides about both the title that is displayed in the NavigationBar (displayed at the top) and all the navigation buttons, for example the back-buttons in the navigation bar itself. Now I plan to put a bit more information into the NavigationBar‘s title, while still keeping those button labels short and concise (for example the view‘s title is “<Customer name>

NavigationBar becomes black on pop

南笙酒味 提交于 2019-12-02 01:25:18
Second Image The issue is when i pop my controller the navigation bar becomes black which is very irritating. Help required! Nikunj When you Pop Your Screen You get back to Previous Screen. In Preview screen you have to call this method in viewWillAppear. -(void) viewWillAppear: (BOOL)animated{ [self.navigationController setNavigationBarHidden:YES animated:animated]; [super viewWillAppear:animated]; } This will work for me. Đức Minh This is the Swift version of @Nikunj answer. override func viewWillAppear(_ animated: Bool) { navigationController?.setNavigationBarHidden(true, animated: animated

Separate title in NavigationBar and navigation buttons

ⅰ亾dé卋堺 提交于 2019-12-02 01:16:57
Hey, I have a stack of UIViewController s inside of a UINavigationController . Usually the title (or the NavigationItem‘s title) decides about both the title that is displayed in the NavigationBar (displayed at the top) and all the navigation buttons, for example the back-buttons in the navigation bar itself. Now I plan to put a bit more information into the NavigationBar‘s title, while still keeping those button labels short and concise (for example the view‘s title is “<Customer name> Overview”, while the buttons should just show “Overview”). I am currently trying to achieve this by changing

UINavigationBar background image with scaleAspectFill-like behavior

为君一笑 提交于 2019-12-02 00:55:00
tl;dr I'm trying to set a background image for a UINavigationBar . Is there a way to configure the navbar so that it uses scaleAspectFill -like behavior (as a UIImageView with contentMode set to scaleAspectFill )? The goal I have an image roughly fitting the navbar dimension of a landscape iPhone (64pt height, about 800pt width; the exact dimension should not matter here though), which I set with navigationBar.setBackgroundImage(img, for: .default) . The image is a blurred photo, so no need for pixel-perfection. Btw -- I'm using UINavigationBar.appearance to set the background for all navbars

How to change the color of UINavigationBar?

断了今生、忘了曾经 提交于 2019-12-01 22:59:06
I want to change the color of UINavigationBar , color will be taken from an image. try to set the objects as subviews to the navigationBar. Set the tint color property or use images UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:rootController]; controller.navigationBar.tintColor = [UIColor blackColor]; In iOS 7 or later, try the following: navigationBar.barTintColor = [UIColor redColor]; If you are supporting only iOS5 and later, you can use "appearance proxy". There is a good tutorial for this . If you have to support prior versions, you have

UINavigationController not popping UINavigationBar items

霸气de小男生 提交于 2019-12-01 21:52:57
问题 I'm having a problem where my UINavigationBar isn't popping it's items when the UINavigationController pops a view controller. I have had a look at the stacks observed the following: The expected number of navigation controllers allocated (checked in instruments) There are the correct number of controllers on the stack. (debug logging) The navigation items aren't being popped. (debug logging) Here's what I did. I popped some log statements into the viewDidLoad method after calling super.

Tweak UI Navigation on iOS 11

早过忘川 提交于 2019-12-01 21:23:44
问题 I have a problem with a navigation bar in iOS 11. I use this code: [UINavigationBar appearance].prefersLargeTitles = YES; ...to set a new style for my app. It works well untill a user pull to refresh on the table view; then it breaks. This is before pull-to-refresh: ...and this is _after: Note: I use the table view controller's built-in pull-to-refresh control. I searched for a solution but it still eludes me. If someone knows how to fix this please drop some advice. Thanks for the support :)

Change iOS 11 large title color

旧时模样 提交于 2019-12-01 20:55:44
问题 I'm using the new enlarged navigation bar titles in iOS 11. But I can't seem to be able to change the textColor. I tried doing: self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]}; This didn't do anything. Any ideas? 回答1: self.navigationController.navigationBar.largeTitleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]}; 回答2: I think it's still a bug in Xcode 9 beta 6. I found different "solutions" for it