uinavigationbar

iPhone: Move UINavigationBar down?

旧城冷巷雨未停 提交于 2019-12-20 04:27:16
问题 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

Add Navigation Bar in UICollectionView in swift 4, iOS 11

别等时光非礼了梦想. 提交于 2019-12-20 03:12:40
问题 After upgrading the iOS 11 and swift 4(Xcode 9), I got lots of UI problem. :( The most unsolvable problem is Navigation Problem. I put the Navigation Bar in UICollectionView Controller . Navigation bar height does not show properly and however I write the code. I set navigation bar height "100". I write this code in ViewDidLoad(). if #available(iOS 11.0, *) { print("IOS 11 Screen") UINavigationBar.appearance().largeTitleTextAttributes = [ NSForegroundColorAttributeName: UIColor.white, ]

How to change the color of UINavigationBar?

眉间皱痕 提交于 2019-12-20 03:03:24
问题 I want to change the color of UINavigationBar , color will be taken from an image. 回答1: 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]; 回答2: In iOS 7 or later, try the following: navigationBar.barTintColor = [UIColor redColor]; 回答3: If you are supporting only iOS5 and later

What's the best way to add a view under UINavigationBar in iOS7

二次信任 提交于 2019-12-20 01:10:53
问题 On ios7, a lot of apps (Apple Messages, Facebook Messenger, Calendar)have views appearing under the UINavigationBar, often with what seems to be standard animation. As it seems quite standard and looks a lot with a UIToolBar, I was looking for the standard way of implementing it but couldn't find anything. Is there a better way to adding a UIToolBar to the UINavigationBar? 回答1: You should follow this simple approach. Add a UIToolBar like this. UIBarButtonItem *flexiableItem = [

How do I add a left bar button without overriding the natural back button?

◇◆丶佛笑我妖孽 提交于 2019-12-19 19:45:45
问题 I have a project that uses UIViewControllers embedded in navigation view controllers, so the back button is automatically set up for me whenever I segue into any detail of my tableviews. Now I want to add an Edit button beside the back button. I've already put an Unassign button on the right side, and since the word "Unassign" is quite long, I'd rather fit the Edit button beside the back button on the left side. I know I can programmatically add bar buttons with navigationItem

Why am I getting an UIBarButtonItem customization warning?

时光怂恿深爱的人放手 提交于 2019-12-19 17:43:59
问题 I have a simple storyboard with a table view inside a navigation view controller that pushes from the table view to another view controller that has a full screen image view. The table view has a prompt text in it's navigation bar. When I tap on the table view cell in the table view I receive the warning below. I'm not customizing the back button at all. I created a sample project showing the issue. https://github.com/stevemoser/UIBarButtonItemCustomizationWarningExampleProject Anyone have an

Separator between navigation bar and view - iOS 7

Deadly 提交于 2019-12-19 12:52:22
问题 In iOS 7 there's a grey separator between the navigation bar and the view. Back in iOS 6, there wasn't that horizontal line, thus the view would blend in with the navigation bar as if they were the same image. Now I don't know how to remove it... I've tried resizing the view / navigation bar, but it doesn't help. Any ideas? 回答1: Try with self.navigationController.navigationBar.translucent = NO; In your viewDidLoad method and let me know :) If you need this effect on every ViewController, you

How to add custom navigation bar to a full-screen VC in iOS 7 and make it tint the status bar to match?

旧巷老猫 提交于 2019-12-19 11:31:05
问题 In an app I'm developing (Xcode 5, >=iOS 7 auto-layout), I push a modal view controller. I want the modal view controller to have a navigation bar, so I add one, and add a constraint that positions it with it's top aligned with the top layout guide, so it is placed just under the status bar. (I'm using my own navigation bar because I want to take advantage of the system's management of the edit button and add button nav bar items. ) The standard navigation bar has a very subtle light gray

How to add custom navigation bar to a full-screen VC in iOS 7 and make it tint the status bar to match?

二次信任 提交于 2019-12-19 11:31:04
问题 In an app I'm developing (Xcode 5, >=iOS 7 auto-layout), I push a modal view controller. I want the modal view controller to have a navigation bar, so I add one, and add a constraint that positions it with it's top aligned with the top layout guide, so it is placed just under the status bar. (I'm using my own navigation bar because I want to take advantage of the system's management of the edit button and add button nav bar items. ) The standard navigation bar has a very subtle light gray

UINavigationBar title

半世苍凉 提交于 2019-12-19 10:35:17
问题 I am trying to use a UILabel to replace the title at the UINavigationBar, the code is as follows: UINavigationBar *bar = [self.navigationController navigationBar]; [bar setBackgroundColor:[UIColor blackColor]]; UILabel * nav_title = [[UILabel alloc] initWithFrame:CGRectMake(80, 2, 220, 25)]; nav_title.font = [UIFont fontWithName:@"Arial-BoldMT" size:18]; nav_title.textColor = [UIColor whiteColor]; nav_title.adjustsFontSizeToFitWidth = YES; nav_title.text = title; nav_title.backgroundColor =