uinavigationitem

Back-like arrow on iOS 7

ぃ、小莉子 提交于 2019-12-09 15:08:24
问题 I need to add a left bar button item in my app that looks like system back button, but is not the system back button, since it will appear on view controller that is the only vc of my navController's stack and execute my own code. Simply writing "Back" isn't really good for me, as I need to display the "<" arrow as well. Is there a way to programmatically create an arrow like that, without making image with that arrow? 回答1: Consider using a dummy UIViewController as a root view controller for

iOS 5 Back Button Size

耗尽温柔 提交于 2019-12-09 13:50:07
问题 I'm using the iOS 5 UIAppearance protocol to use a custom navigation bar back button as seen here. Unlike other methods I've found, this one is the best since it preserves the default back button animations and behaviours. The only problem is that I can't change its size or set it to not clip subviews . Here's what's happening: A is intended behaviour, B is default style, C is the clipped result. Unfortunately, it's not as easy as setting UIBarButtonItem to clipsToBounds=NO. Does anyone know

How to change tintColor of UIBarButtonItem in Swift?

*爱你&永不变心* 提交于 2019-12-08 17:35:54
问题 I want to change the color of my right bar button item from black to white. It is a button as a search icon. I have not coded the search implementation yet as I want to get the main interface completed first. I thought that I'd written the correct codes so it should appear as white, but it seems to still appear as black in both the storyboard and simulator. In the storyboard, I have also set it to white. Here is my code, which is located in the AppDelegate.swift file: func application

How to change background color of UINavigationItem?

我与影子孤独终老i 提交于 2019-12-06 19:50:09
问题 I have a UINavigationItem , but I can't found anything beside tittle, prompt, and back button in attribute inspector I wonder how can I change my UINavigationItem background color using code? or programmatically? 回答1: You can change it through code... For Objective-C: self.navigationController.navigationBar.barTintColor = [UIColor redColor]; Write Above line in viewDidLoad method. For Swift: self.navigationController?.navigationBar.barStyle = UIBarStyle.BlackTranslucent self

UIBarButtonItem in middle of navbar?

旧街凉风 提交于 2019-12-06 13:43:27
问题 I have created a flexible navigation bar in my app that will show custom buttons on the left, right, and in the middle. So far I have got working: Right/Left/Middle - Custom Image and/or Text Right/Left - Normal looking button with custom Image in it Right/Left - Normal looking button with custom Text in it By 'normal looking' I mean the default UIBarButtonItemStyle- just a nice shiny button. My question is, how can I achieve the same look in the MIDDLE of the nav bar? I can do custom/text

How to Add UIImageView with UILabel in navigation bar of iphone?

馋奶兔 提交于 2019-12-06 13:15:11
问题 I have some navigation bar in my UI of iphone app. Now i want to add two images on the navigation bar on center of the navigation bar.. I have successfully added the two UIImageView on the navigation-bar but my problem is that i have two UIImageView with the label on it .. Let me show u the snapshot ... now my problem is i don't know how to add this kind of label near UIImageView in navigation bar..so please if anyone can guide me for this then it will help me a lot.. i have already

UISearchBar and UINavigationItem

好久不见. 提交于 2019-12-06 12:04:42
问题 I can't seem to get a UISearchBar to position itself from the far left to the far right in the navigation bar. In the -(void)viewDidLoad method, I have the following code: UISearchBar *sb = [[UISearchBar alloc] initWithFrame:self.tableView.tableHeaderView.frame]; sb.delegate = self; self.navigationItem.titleView = sb; [sb sizeToFit]; [sb release]; When you build and run, it looks just fine at first glance. However, looking more closely, you can tell there is a margin/space on the left. This

use [UINavigationBar appearance] to change back button image

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 09:33:12
I'd like to change the back button of my UINavigationBar I can do it using this code: // Set the custom back button UIImage *buttonImage = [UIImage imageNamed:@"backag.png"]; //create the button and assign the image UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setImage:buttonImage forState:UIControlStateNormal]; [button setImage:[UIImage imageNamed:@"selback.png"] forState:UIControlStateHighlighted]; button.adjustsImageWhenDisabled = NO; //set the frame of the button to the size of the image (see note below) button.frame = CGRectMake(0, 0, 30, 30); [button addTarget

UINavigationController back button problem in landscape mode?

这一生的挚爱 提交于 2019-12-06 07:58:19
问题 my iphone application supports portrait mode earlier, now i want to support land scape mode also. everything is working fine in my application except the navigation controller back button. i have used tableviews in navigaton conroller, when i click back button in landscape mode view is getting poped and its loading its previous view but animation is strange. i have given default animation but, in landscape mode view is is animating upside down instead of default left to rite when i click back

How to remove UINavigatonItem's border line

故事扮演 提交于 2019-12-06 05:42:13
问题 Is it possible to remove UINavigationItem's border? My view under black nav. bar is black and i don't want no visual border between them. To make it clearer (image is not from my app): 回答1: You can't hide it. You can add a subview that will mask it. Example: UIView *overlayView = [[UIView alloc] initWithFrame:CGRectMake(0, 43, 320, 1)]; [overlayView setBackgroundColor:[UIColor whiteColor]]; [navBar addSubview:overlayView]; // navBar is your UINavigationBar instance [overlayView release]; I