uinavigationbar

How to change UINavigationBar background with image on some views but not all?

百般思念 提交于 2019-12-13 17:39:58
问题 I would like to set an image as UINavigationController background but most solutions I found apply background in navigation bar for all views in the app. Can you give some code that may help ? Thx for helping, Stephane 回答1: Here's a quick and dirty way that I use in one of my projects (I have no need to support landscape orientation). I implemented it with a category to UINavigationBar with method swizzling. Works on iOS 4 and 5 (I didn’t try it on iOS 3). UINavigationBar+SYCustomBackground.h

UINavigationBar change title text color and font size

家住魔仙堡 提交于 2019-12-13 13:11:16
问题 I want to change navigation title's font and color..so, for that i've done this below code..but its not working... if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7")) { NSDictionary *navbarTitleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], NSForegroundColorAttributeName, [UIFont fontWithName:@"MyFavoriteFont" size:20.0], NSFontAttributeName, nil]; [[UINavigationBar appearance] setTitleTextAttributes:navbarTitleTextAttributes]; NSLog(@"setTitleTextAttributes

Navigation Controller not working properly

こ雲淡風輕ζ 提交于 2019-12-13 12:42:46
问题 I am using a navigation controller in my current application, but I had an issue with the navigation controller with the iOS4 and iOS5 so i tried to write the code for both iOS 4 & 5 if([[UINavigationBar class] respondsToSelector:@selector(appearance)]) //iOS >=5.0 { [self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault]; } else { self.navigationController.navigationBar.layer.contents = (id)[UIImage imageNamed:@"header.png"].CGImage; } But problem

Custom height for UINavigationBar or alternative of UINavigationBar

青春壹個敷衍的年華 提交于 2019-12-13 12:32:32
问题 I have a viewController with navigation bar. I want to increase the height of navigation bar but I can't. I already search about increasing the height of navigation bar but not get any success. Is there any to increase the height of navigation bar or any other lib/alternative? 回答1: You can use your custom view as your navigation bar. Customize view as per your requirement and hide the default navigation bar as [self.navigationController setNavigationBarHidden:YES]; You can give back action on

iOS 7 Navigationbar background image issue

╄→гoц情女王★ 提交于 2019-12-13 12:12:59
问题 I am using Image as Navigation bar background Image. To set Image I used following code: [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"nav_logo_ios7.png"] forBarMetrics:UIBarMetricsDefault]; For iOS7 "nav_logo_ios7.png" image size is 768x64 and for iOS6 and bellow I used image has size 768x44. This is working well on all UIViewControllers . In same project I am using UIActivityViewController . On iOS7 mail compose view look like this: How I can handle this? Thanks in

application life cycle issue

纵饮孤独 提交于 2019-12-13 11:15:17
问题 i have made changes in navigation bar means i have increasd the height of navigation bar & made some custom changes,it works fine but when i minimizes the application and again maximize it, it shows only original height that is what changes i made, those not works after minimization, my code is - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSLog(@" i m in didFinishLaunchingWithOptions" ); [[UINavigationBar appearance]

Start second view controller of navigation stack first

混江龙づ霸主 提交于 2019-12-13 08:46:03
问题 There is a default calendar app. It starts with the next view controller and back button is already there like there some other view controller was started before this one: When you press back button you get the next view controller: How did they do it? In my app I need the same logic (to start a view controller with the latest or default category but users can press back button to select a different category) 回答1: If I were to do this, I would start by simply using pushViewController

swift navigation bar title remove animation

萝らか妹 提交于 2019-12-13 07:35:58
问题 I have added Page Control to the title of navigation bar from Interface Builder. When the view push/pop to the next view, the Page Control animates (as how normally title would animate). How do i prevent the Page Control from animating? I have something like this but it didn't work: self.navigationItem.titleView?.removeMotionEffect(UIMotionEffect()) 回答1: Solved it. I need to create a new Page View Controller to manipulate the Page Control that I have placed on the navigation bar. Instead of

Separating UIAppearence code

爱⌒轻易说出口 提交于 2019-12-13 06:21:36
问题 I want to implement add themes to an app I'm creating. Simply just switching between 2 colors and I want the navigation bars, tool bars etc. to appear in the selected color. When the app first loads, I apply one color to in the didFinishLaunchingWithOptions method in the AppDelegate. UIColor *blueTheme = [UIColor colorWithRed:80/255.0f green:192/255.0f blue:224/255.0f alpha:1.0f]; UIColor *pinkTheme = [UIColor colorWithRed:225/255.0f green:87/255.0f blue:150/255.0f alpha:1.0f]; [

UINavigationBar moving under status bar when another viewController hides status bar

我是研究僧i 提交于 2019-12-13 05:51:47
问题 The problem is simple, the Profile viewController has a NavigationBar just under the status bar. I push another viewController on top of the current one. This new viewController hides the status bar. When I go back to the Profile viewController , the navigationBar has moved up by the size of the status bar height. I tried to force a layout refresh in my viewWillAppear but it doesn't work. Any ideas? 回答1: Implement viewDidDisappear in that presented viewcontroller and show status bar again