uinavigationbar

Set Status Bar Tint Colour

时光毁灭记忆、已成空白 提交于 2019-12-02 06:40:46
问题 I have an tabbed bar application and the status bar tint colour is set to default - so it is always my selected blue colour throughout my app. However, in one view, I am hiding my Navigation Bar like so: [self.navigationController setNavigationBarHidden:YES]; This is in the viewWillAppear method and the view is accessible as it is one of the tabs of my app. The reason I am hiding it, is because I would like to put a toolbar (with about 6 buttons) in its place. I have set the tint colour of my

iOS 8 - Set Status Bar Color (when your UINavigationBar has a nil backgroud image)

孤街浪徒 提交于 2019-12-02 06:34:38
I am using a view pager in my app (specifically ICViewPager). To make the View Pager blend into the Navigation bar like so: I had to put these lines of code in my AppDelegate.m [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]]; However, this causes the status bar not to be the same color as my navigation bar. How do I set the color of my status bar to be the same as my navigation bar? How do I set the color of my status bar to be the same as my navigation bar? You don

UITextfield not working as subview to UISearchBar in iOS 7?

自作多情 提交于 2019-12-02 06:12:45
问题 This code worked perfectly fine in iOS 6 but in iOS 7 the textfield is gray in the navigationBar, and not clickable? See the difference in this picture What may be wrong ? I am not aware of what they have changed exactly in iOS 7 and not sure where to start looking for solving this problem... /Regards UITextField *sbTextField = (UITextField *)[searchBar.subviews lastObject]; [sbTextField removeFromSuperview]; CGRect rect = searchBar.frame; rect.size.height = 32; rect.size.width = 210;

Displaying notification badge like counter in UINavigationbar

我的未来我决定 提交于 2019-12-02 05:56:47
I have a requirement to display number of pending notifications in iPhone navigation bar. The appearance should be like that of notification badge - but these are not APNS notifications. They are the ones sent from private server with similar purpose. I tried adding a right/left button ( UIBarButtonItem ) in my UINavigationbar but it seems like it is very rigid in appearance. I can't set its width, fonts etc. See my code: self.notifButton = [[UIBarButtonItem alloc] initWithTitle:@"0" style: UIBarButtonItemStyleBordered target:self action:@selector(TouchNotif)]; NSMutableArray *items = [

Set Status Bar Tint Colour

别来无恙 提交于 2019-12-02 05:53:14
I have an tabbed bar application and the status bar tint colour is set to default - so it is always my selected blue colour throughout my app. However, in one view, I am hiding my Navigation Bar like so: [self.navigationController setNavigationBarHidden:YES]; This is in the viewWillAppear method and the view is accessible as it is one of the tabs of my app. The reason I am hiding it, is because I would like to put a toolbar (with about 6 buttons) in its place. I have set the tint colour of my toolbar, however, the status bar on this view is always black. Is there a way to re-set the status bar

Change Both Title Text Color and Font in all Navigation Bars

醉酒当歌 提交于 2019-12-02 05:44:12
I am using swift 2 and the newest version of Xcode and I am trying to change the font size, name, and color of the Title Text in every Navigation Bar. I wrote the following code in my AppDelegate section in the didFinishLaunchingWithOptions area but it only changes the color, the size or type of font is not affected. When I get rid of the color line, then the title follows the NSFontAttributeName line. Is there a way to have both lines of code perform? I haven't found anything that allows you to change both in code... func application(application: UIApplication, didFinishLaunchingWithOptions

NavigationBar becomes black on pop

主宰稳场 提交于 2019-12-02 04:35:33
问题 Second Image The issue is when i pop my controller the navigation bar becomes black which is very irritating. Help required! 回答1: 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. 回答2: This is the Swift version of @Nikunj answer. override func

Objective-C: Background image and title in Navigation Bar

痴心易碎 提交于 2019-12-02 04:28:48
In need a background image AND a title in my Navigation Bar. For the image I write a category: @implementation UINavigationBar(MyNavigationBar) - (void)setBackgroundImage { UIImageView *aTabBarBackground = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"navBarBackgrd.png"]]; [self addSubview: aTabBarBackground]; [self sendSubviewToBack: aTabBarBackground]; [aTabBarBackground release]; } @end I call this category in my AppDelegate and have background images in the whole application: [navigationController.navigationBar setBackgroundImage]; Every ViewController has a title: [self setTitle

iPhone: Move UINavigationBar down?

…衆ロ難τιáo~ 提交于 2019-12-02 04:26:58
I'm trying to position the navigation bar below the top of the screen. I've tried the following in viewWillAppear : self.navigationController.view.frame = CGRectMake(0.0, 54.0, 320.0, 426.0); self.navigationController.navigationBar.frame = CGRectMake(0.0, 0.0, 320.0, 44.0); The problem is it only seems to work the very first time the view is displayed. If you go to another tab, and back, the navigation bar is at the top of the screen. This also happens when the iPhone is rotated. Should I be trying to adjust the navigation controller frame, or should I instead try to add the navigation

Setting title for UINavigation bar in iphone

限于喜欢 提交于 2019-12-02 04:23: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=[