uinavigationbar

UINavigationBar custom transition animation

放肆的年华 提交于 2019-11-30 09:03:29
I've created custom transitions between view controllers using the following protocols: UIViewControllerAnimatedTransitioning and UIViewControllerTransitioningDelegate Is it possible using the default UINavigationBar , to create custom transitions for the titles, right now they simply crossfade between view controllers, Or do i have to built my own navigation bar view from scratch? WWDC 2013 video #218 indicates that all custom transitions will crossfade the navigation bar, and that there's no way to customize this behavior. xaphod If your transition is both custom and interactive, then you

iOS: Positioning navigation bar buttons within custom navigation bar

帅比萌擦擦* 提交于 2019-11-30 08:18:18
问题 I'm building an app with a custom navigation bar. After some research I decided to do this using a category on UINavigationBar. The navigation bar needs to be a bit larger than usual to accomodate a drop shadow. Here is the code: #import "UINavigationBar+CustomWithShadow.h" @implementation UINavigationBar (CustomWithShadow) - (void)drawRect:(CGRect)rect { // Change the tint color in order to change color of buttons UIColor *color = [UIColor colorWithHue:0.0 saturation:0.0 brightness:0.0 alpha

UINavigationBar appearance refresh?

强颜欢笑 提交于 2019-11-30 08:13:17
In my iPad app I have an application settings view. One of the options lets the user switch interface color scheme. The settings view is loaded by segue to a separate view controller than my "main" app's window. When they pick a new color I switch the colorSchemeColor variable and do this: // set the colors and refresh the view [[UINavigationBar appearance] setBarTintColor:colorSchemeColor]; [[UIToolbar appearance] setBarTintColor:colorSchemeColor]; [[UITabBar appearance] setBarTintColor:colorSchemeColor]; However, none of the bars change color until I exit my settings view! (When the settings

set navigationBar background image in swift

陌路散爱 提交于 2019-11-30 07:57:44
问题 Code below is not working for me, can anyone help to figure it out what is wrong? var image = UIImage(named: "10384605_10152519403846670_5189785375955620548_n.jpg") as UIImage self.navigationController.navigationBar.setBackgroundImage(image , forBarMetrics:UIBarMetrics) 回答1: self.navigationController.navigationBar.setBackgroundImage(image, forBarMetrics: .Default) 回答2: In AppDelegate.swift func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject:

How do I “legally” fade out the navigation bar in an app?

北战南征 提交于 2019-11-30 06:53:14
It seems the only way to remove a navigation bar with animation is via it sliding upward. I want it to fade, like in Photos.app. It would be easiest to change the alpha, however Apple's guidelines state : Prior to iOS v5.0, when used in conjunction with a navigation controller, there are only a handful of direct customizations you can make to the navigation bar. Specifically, it is alright to modify the barStyle, tintColor, and translucent properties, but you must never directly change UIView-level properties such as the frame, bounds, alpha, or hidden properties directly. The language is a

UINavigationBar BarButtonItem with Plain Style

笑着哭i 提交于 2019-11-30 06:36:38
问题 i got the following code: - (id)init { if (self = [super init]) { self.title = @"please wait"; UIBarButtonItem *favorite = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"star.png"] style:UIBarButtonItemStylePlain target:self action:@selector(buttonFavoriteClicked:)]; self.navigationItem.rightBarButtonItem = favorite; } return self; } but my button looks still like a Button with UIBarButtonItemStyleBordered is there a way to set a button with plain style at this position? 回答1:

Change UINavigationItem colour

梦想的初衷 提交于 2019-11-30 05:39:38
问题 I need to set custom colors to my UINavigationBar buttons. I'm doing the following thing(RGB func is a define): - (void)viewWillAppear:(BOOL)animated { for (UIView *view in self.navigationController.navigationBar.subviews) if ([[[view class] description] isEqualToString:@"UINavigationButton"]) [(UINavigationButton *)view setTintColor:RGB(22.0,38.0,111.0)]; } Everything looks fine on app load. after leaving the view and getting back the color returns to default. Secondly I need to set the same

Custom background for UINavigationBar problems

半世苍凉 提交于 2019-11-30 05:32:21
I've managed to add a custom background to my navigation bar by using: UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"UINavigationBar.png"]]; [myViewController.navigationBar insertSubview:iv atIndex:0]; [iv release]; This works fine and I can see the title and buttons okay. However, when I drill down one level and then go back to the root, the buttons are hidden, but the title is still visible. It appears the navigation bar image is covering the button items. I'm confused as I'm inserting it at the bottom so I would assume when the navigation items are pushed and

How to remove padding next to a UIBarButtonItem

◇◆丶佛笑我妖孽 提交于 2019-11-30 05:30:16
问题 I have added a custom button to the navigation bar's custom right bar button item as shown in the image. I'm want to be able to remove the space after the button so that it touches the right edge of the screen but couldn't find a solution even after searching. If someone could mention how, would be great. This is the code I'm using UIButton *aButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; aButton.frame = CGRectMake(50.0, 0.0, 60, 44); UIBarButtonItem *aBarButtonItem = [

iPhone: UINavigationBar with buttons - adjust the height

廉价感情. 提交于 2019-11-30 05:21:05
I am working on an iPhone application which works in both orientations: portrait and landscape. I am using for one view and tableview embedded in an UINavigationController. The height of this navigationbar with its buttons is either: 44px portrait or 34px landscape. Within a different view I created the UINavigationBar by myself and I am able to set the frame for the correct size, but the embedded UINavigationItem with UIBarButtonItem doesn't shrink. So for the 34 px in the landscape mode this button is to big and overlaps the navbar in the height. The funny thing is though, that this worked