uinavigationbar

How to prevent view resizing/transform when UINavigationBar hides/shows

让人想犯罪 __ 提交于 2019-12-03 15:08:00
I have an application with a tab bar and a navigation bar. I push a view controller that is used to show photos, one at a time. It initially shows the bars and forward/back controls; after a delay, these hide, using setNavigationBarHidden:animated: and a custom transform ( CGAffineTransformMakeTranslation ) on the tab bar. This works, but the view controllers view , which shows the photo, leaps up and down. The same is true if I leave the tab bar out of the equation. How can I prevent the UINavigationBar from moving my view around? I would like the photo to stay fixed in the screen, with the

Create a custom left back button on UINavigationBar WITH the standard arrow on the left

爱⌒轻易说出口 提交于 2019-12-03 14:58:47
问题 When I create a custom back button, I use the following code: UIBarButtonItem *leftButton = [[UIBarButtonItem alloc]initWithTitle:@"Yeah" style:UIBarButtonItemStyleBordered target:self action:@selector(backButtonPressed:)]; self.navigationItem.leftBarButtonItem = leftButton; This works fine, and I obtain this result: I would have the same result, but with an arrow on the left, like this (when it's a standard back button, not a custom one): How can I simply add this arrow ? 回答1: Finally, here

How do I get the width of the back button in a UINavigationBar?

你说的曾经没有我的故事 提交于 2019-12-03 14:15:34
问题 We have a controller that might be pushed from several places, so its back button might have one of several titles. It also has a button that pops up another controller. They both have the same custom title element, but they're centred differently because the second controller has no back button. I'd like to add a spacer to fix this, but I don't know what width to make it. How do I get the width of the back button in a UINavigationBar? 回答1: You could always spelunk through the navigation bar

Custom logo on top of UINavigationBar?

孤街浪徒 提交于 2019-12-03 14:02:42
问题 I've read plenty of requests about a full-on custom UINavigationBar background, but what I want is to overlay a logo on the default UINavigationBar instead of text. Preferably, I'd like to apply it to a subclass of UINavigationBar called CustomNavigationBar. 回答1: Neat tricks, Shadow. If you just want to add a logo instead of a title, that's easy. Set the titleView on your navigationItem, like so: UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Logo"]]; self

How can I set custom font in UINavigationBar?

六眼飞鱼酱① 提交于 2019-12-03 13:31:57
问题 How can I set custom font in UINavigationBar ? I need the tahoma font. - (void)viewDidLoad{ self.title =@"My text"; } 回答1: Totally possible, if a little tricky to do. Once you've found the font you need (either one of the alternatives already shipped with iOS, or a TTF file that you've got the correct licensing for), just create a UILabel with the size, formatting, font etc and then add it to the navigation items for that bar (or, if you're doing this in a view controller, set the

iOS 7 multitasking switcher: Navbar appears black

醉酒当歌 提交于 2019-12-03 12:18:46
问题 The preview window/multitasking switcher shows a weird behaviour in iOS 7. Here is how it appears when I set this property for both apps. self.navigationController.navigationBar.translucent = NO; Now for the white app I commented the line. Now when I run it again and go directly to the switcher, this is what I get: If I run the app and then go to the home screen or any other app and then go to the switcher, this is what I get: Is there any way to correct this problem while having translucent

Add image to a navigationItem's title

南楼画角 提交于 2019-12-03 12:12:33
I'd like to add a logo to the left of my title on my navigation bar. The title property seems to only take an NSString. What's the best way to add an image to the navigation bar? You can replace the title view with an image like this: navigationItem.titleView = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"title_bar.png"]]; Adam Ernst Set UINavigationItem.titleView to a custom view (or just a straight UIImageView). BlessNeo You can customize navigationItem.titleView , class of UIView 来源: https://stackoverflow.com/questions/328352/add-image-to-a-navigationitems-title

How to hide/disable only the first uinavigationbar?

六月ゝ 毕业季﹏ 提交于 2019-12-03 11:34:24
I've been wandering how to hide / remove / disable only the main or first navigation bar in the navigation controller so that I could put an image as a whole background screen but I couldn't find any solution. Did try hide the titleview in viewdidLoad of the main navigation controller but didn't work. Tried using navigationBarHidden but it hides the whole navigation bar for the next stack of controller. So, I'm not sure how to do this. To give you an example, I would like to have something like this app - The Masters Golf Tournament - http://appshopper.com/sports/the-masters-golf-tournament .

How to make UIToolbar have a Clear Background?

送分小仙女□ 提交于 2019-12-03 11:33:40
问题 I have a UIToolbar that has a white tint, with a bar button item, followed by some flexible space, followed by another bar button item. I would like to make the toolbar completely clear so that I can see what is under the flexible space (I don't care about seeing what is behind the buttons). Is there a way to do this? I have tried setting the toolbar to translucent, but that does not make it completely clear. 回答1: [self.toolbar setBackgroundImage:[UIImage new] forToolbarPosition

setBackgroundImage forBarMetrics image size?

非 Y 不嫁゛ 提交于 2019-12-03 09:50:12
问题 I am fairly new in iOS programming and I am creating my first app. I have been trying to use the following code to change the navigation bar background image (this is using the new iOS 5 method): [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"gradientBackgroundPlain.png"] forBarMetrics: UIBarMetricsDefault]; It works fine, but my image is 640 x 88 and it looks too big for the bar. It's like the system doesn't want to scale it, or do I need to do it manually?