uinavigationbar

How to make completely transparent navigation bar in iOS 7

陌路散爱 提交于 2019-11-27 02:23:05
I want the UINavigationBar in my app to be completely transparent and flush with the viewcontroller directly under it. However, the only code I could find makes it translucent but not transparent. I know this can be done in iOS 7 because it is used in the notes app. My question is, what is the code they used to do it? Alan From this answer [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; self.navigationController.navigationBar.shadowImage = [UIImage new]; self.navigationController.navigationBar.translucent = YES; self

iOS 11 - Unable to change Navigation Bar height

隐身守侯 提交于 2019-11-27 02:21:39
问题 I am working on an application and I just upgraded to Xcode 9 / Swift 4 and also upgraded my iPhone to iOS 11. The application was installed when I installed iOS 11 and all seemed OK until I run it from Xcode. Now I am stuck with the default NavBar height. The code I was using to change the height is no longer working: class CustomNavControllerVC: UINavigationController { let navBarHeight : CGFloat = 64.0 let navbarBackButtonColor = UIColor(red: 247/255, green: 179/255, blue: 20/255, alpha: 1

Animate nav bar title text change

∥☆過路亽.° 提交于 2019-11-27 01:26:36
问题 In my app, I have a page view controller that allows the user to swipe between different "sections" of the app, and at the top in the nav bar I change the title text to the new section the user has swiped to via pageViewController:didFinishAnimating:previousViewControllers:transitionCompleted: . It is currently instantly changing the title text when the animation has completed. I would like to improve this with some animation, a subtle fading in and out effect. I first tried to implement

How can I change height of Navigation Bar Swift 3

风流意气都作罢 提交于 2019-11-27 01:26:19
I'm pretty sure this is not duplicate because I looked at other answers and they all outdated and do not provide exact answer. I have Navigation Controller and several view controllers. I want to make Navigation Bar a bit taller so it would fit text size that I need. How can I do that ? I tried this: UINavigationBar.appearance().frame = CGRect(x: 0.0, y: 0.0, width: 320.0, height: 210.0) but nothing happens... Also, I wasn't able to add any constraints to the Nav Bar using Xcode layout buttons. Hope somebody can help me to fix this issue. Thanks in advance! Frankie Here is one way to do it:

Customize navigation bar with title view

大憨熊 提交于 2019-11-27 01:14:53
问题 I am trying to add a custom view in the center of a navigation bar and I am using the following code to test it: UIView * testView = [[UIView alloc] init]; [testView setBackgroundColor:[UIColor blackColor]]; testView.frame = CGRectMake(0, 0, 100, 35); [self.navigationController.navigationItem.titleView addSubview:testView]; I am setting this up in the viewDidLoad method of my view controller but when i run my program nothing seems to change in my navigation bar. Could you help me with this?

iOS 11 large navigation bar title unexpected velocity

☆樱花仙子☆ 提交于 2019-11-27 01:14:31
问题 I am trying to implement the iOS 11 native large navigation bar title on my new application. By calling below functions in viewDidLoad(): navigationController?.navigationBar.prefersLargeTitles = true navigationController?.navigationItem.largeTitleDisplayMode = .always I do get what I desired. But, when I start scrolling up (the only view inside the main view is a scroll view), the scrolling makes the large title disappear at a faster velocity than actual scroll with the finger. (that is, if I

UINavigationBar autoresizing

吃可爱长大的小学妹 提交于 2019-11-27 01:10:54
问题 In my app, I got a UINavigationController. Unfortunately, when I rotate the device and the interface orientation changes, the UINavigationBar doesn't change its height. In other iPhone applications, such as the Contacts.app, the navigation bar gets slightly less tall in landscape mode. It must be built-in, because if you take the navigation sample app from the XCode menu and add interface orientation to it, it does change the navigation bar's height properly. How can I make the navigation bar

UINavigationController interactivePopGestureRecognizer working abnormal in iOS7

回眸只為那壹抹淺笑 提交于 2019-11-27 01:02:25
问题 In iOS7, we have a new "swipe left to right" gesture, this is a very useful feature, but now I have a problem with it. I use this code to custom the back button in UINavigationBar . self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:view]; but this will disables the "swipe left to right" gesture, so I use the follow code to keep the gesture enabled. self.navigationController.interactivePopGestureRecognizer.delegate = self And then, I found that the gesture is

How to set the text of a back button on a UINavigationBar? [duplicate]

微笑、不失礼 提交于 2019-11-27 00:58:48
Possible Duplicate: How do I change the title of the “back” button on a Navigation Bar The Situation: I have a UIViewController that is governed by a navigation controller. I am able to set the title of the navigation bar covering the UIViewController by simply calling self.title = @"title" . But, I want to be able to set the back button text of the navigation bar, too (for different languages n' such..) The Problem: I don't know how to set the back button's text. The Question: How do I set the back button of the UINavigation bar (programmatically not in IB)? The setTitle way - though may seem

How to change UINavigationBar background color from the AppDelegate

丶灬走出姿态 提交于 2019-11-27 00:43:35
I know how to change the UINavigationBar background image by doing [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"nabbar"] forBarMetrics:UIBarMetricsDefault]; and I know how to set the bar to different colors within each Views ..... Now I want to change the background color without using an image to a solid color from the app delegate . I do not want to set it each time from each view and I do not want to write a CGRect . I tried [[UINavigationBar appearance] setBackgroundColor:[UIColor colorWithRed:33/255.0 green:34/255.0 blue:36/255.0 alpha:1.0]]; but I doesn't work