uinavigationbar

Change UINavigationBar Height

£可爱£侵袭症+ 提交于 2019-11-26 08:16:22
问题 Can some one tell me how to change the navigation bar height? Here is what i have so far: CGFloat navBarHeight = 10; self.navigationController.navigationBar.frame.size.width = navBarHeight; 回答1: You can create a category class based on UINavigationBar like this .h file #import UIKit/UIKit.h @interface UINavigationBar (myNave) - (CGSize)changeHeight:(CGSize)size; @end and .m file #import "UINavigationBar+customNav.h" @implementation UINavigationBar (customNav) - (CGSize)sizeThatFits:(CGSize

UINavigationBar's drawRect is not called in iOS 5.0

。_饼干妹妹 提交于 2019-11-26 08:11:19
问题 I\'ve overrided(placed in category, or swizzled) UINavigationBar\'s drawRect to show custom background. In iOS 5 it\'s not working. What should I do? 回答1: Setting custom background for UINavigationBar to support iOS5 and iOS4 too! http://www.mladjanantic.com/setting-custom-background-for-uinavigationbar-what-will-work-on-ios5-and-ios4-too/ http://rogchap.com/2011/06/21/custom-navigation-bar-background-and-custom-buttons/ As you know, until iOS 5 came out, we used drawRect override in

Real time blur effect for Navigation Bar

帅比萌擦擦* 提交于 2019-11-26 08:06:15
问题 How to achieve the real time blurring effect for the navigation bar just like the Trailers app in iPhone. i.e As you scroll the contents should get blurred behind the navigation bar. Please help me with some code. Thanks! I want to achieve an effect like this:- 回答1: Apple has introduced new classes UIVisualEffectView and more to add translucency and blur effect on views from iOS 8.0 release. Here how you can use it to add blur effect to navigation bar or any other UIView : Swift 2.1 Edit func

iOS 7 Status Bar Collides With NavigationBar

不羁的心 提交于 2019-11-26 07:58:17
问题 I have a view controller in my app that has a navigation bar dragged on it in the storyboard. It was working fine in the iOS 6 but in iOS 7 it look like this: The status bar and the navigation bar should no collide with each other. I have seen a lot of such questions on the stack overflow but they didn\'t of much help to me. Some questions say that i should use this \"self.edgesForExtendedLayout = UIRectEdgeNone;\" but it didn\'t work. Some say i should remove the navigation bar and embed it

How to add a right button to a UINavigationController?

丶灬走出姿态 提交于 2019-11-26 07:53:45
问题 I am trying to add a refresh button to the top bar of a navigation controller with no success. Here is the header: @interface PropertyViewController : UINavigationController { } Here is how I am trying to add it: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@\"Show\" style:UIBarButtonItemStylePlain target:self

Custom nav bar styling - iOS [duplicate]

随声附和 提交于 2019-11-26 07:52:43
问题 Possible Duplicate: How to add background image on iphone Navigation bar ? iOS - How did the NY Times do this custom top navigation bar styling? And for that matter, the bottom one? 回答1: EDIT: This is outdated; for iOS5 there's a much better answer below, by @Jenox. Completely custom styling for Navigation Bars is surprisingly difficult. The best writeup I know of is this one by Sebastian Celis: http://sebastiancelis.com/2009/12/21/adding-background-image-uinavigationbar/ This doesn't

Changing the height of the Navigation bar iOS Swift

放肆的年华 提交于 2019-11-26 07:45:51
问题 I am trying to change the height of there navigation bar for my app. Currently the height is fixed to 44. I can change the width from Xcode but not the height. I have no idea how to change this. Very new to iOS development. Can anyone please help? 回答1: Try this : import UIKit class YourViewController : UIViewController { var navBar: UINavigationBar = UINavigationBar() override func viewDidLoad() { super.viewDidLoad() self.setNavBarToTheView() // Do any additional setup after loading the view.

iOS UINavigationBar button remains faded after segue back

这一生的挚爱 提交于 2019-11-26 07:44:18
问题 In my app I have multiple view controllers, and most have a right-hand-side UIBarButtonItem with direct \"show\" segue actions attached. Having segued to another view and then pressed the \'< Back\' button, the original button item remains faded out, although still otherwise usable. This only appears to happen under iOS 11.2. I can\'t see any setting that could be doing this, and in at least one of the cases where this happens there\'s no specific segue unwinding nor viewDidAppear handling. I

UISearchBar in navigationbar

自作多情 提交于 2019-11-26 07:28:29
问题 How can I show a UISearchBar in the NavigationBar? I can\'t figure out how to do this. Your help is very much appreciated. 回答1: To put searchBar into the center of navigationBar: self.navigationItem.titleView = self.searchBarTop; To put searchBar to the left/right side of navigationBar: UIBarButtonItem *searchBarItem = [[UIBarButtonItem alloc] initWithCustomView:searchBar]; self.navigationItem.rightBarButtonItem = searchBarItem; 回答2: As of iOS 7, the UISearchDisplayController supports this by

How to add background image on iphone Navigation bar?

◇◆丶佛笑我妖孽 提交于 2019-11-26 07:22:22
问题 I want to add an image background to my navigation bar. Is it right? //set custom background image UIImageView *backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@\"NavigationBackground.png\"]]; [self.navigationBar insertSubview:backgroundView atIndex:0]; [backgroundView release]; 回答1: Here's the code from the link @luvieere mentioned. Paste this code into to the rootview controller just above @implementation rootviewController @implementation UINavigationBar