uitoolbar

iOS 7 | Navigation bar / Toolbar buttons very close to status bar

一个人想着一个人 提交于 2019-11-27 02:46:14
I have a problem when dragging a navigation bar or toolbar (storyboard) to my view controller. UINavigationBar: As you can see in the image above, the right button is almost overlapping the status bar. With a UIToolbar it happens the same: This view controllers are intended to be used as a Modal, that's the reason I'm not using a UINavigationController. In another section I use a UINavigationController and it appears as I expect: How can I drag a UINavigationBar / UIToolbar to a view controller without overlapping the status bar? The navigation bars or toolbars have to be at (0, viewController

iOS 7 BarButtonItem with image and title

女生的网名这么多〃 提交于 2019-11-27 01:02:49
问题 I'm trying to figure out how can I achieve something like this: This is a toolbar and I'd like to keep the button title text without having to create the whole image with icon AND text. How can I add the icon to the left of the UIBarButtonItem while keeping the text set with: UIBarButtonItem *customBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Button" style:UIBarButtonItemStyleBordered target:nil action:nil]; EDIT This is what I achieved with the following code: UIButton

Hide UIToolbar UIBarButtonItems

谁说我不能喝 提交于 2019-11-26 22:23:32
问题 I have a UIToolbar that I set up using IB with three buttons, left, middle and right. In some situations I would like to not display the middle button. Does anybody know of a way to hide a specific button on inside a UIToolBar? There is no hide property, all I can find is setEnable but this still leaves the button causing users to wonder what its purpose is. I would like to only display it in situations that it actually has a use. Thanks in advance! 回答1: Reset the items: -(void)setItems:

iOS 7 UIToolBar Overriding With Status Bar

纵饮孤独 提交于 2019-11-26 21:23:46
问题 I have upgraded my project from iOS 6 to iOS 7 but there seems a little problem. The status bar and a tool bar is overriding and very close to each other. The tool bar was earlier added by manually dragging it in the storyboard. This is how its showing up: I have seen a few questions that are suggesting to use "positionForBar:" and "- (UIBarPosition)positionForBar:(id)bar" but i don't know exactly how to use them, a little explanation and easy way to do it might help. Thanks! UPDATE:

How do I show/hide a UIBarButtonItem?

老子叫甜甜 提交于 2019-11-26 21:16:49
I created a toolbar in IB with several buttons. I would like to be able to hide/show one of the buttons depending on the state of the data in the main window. UIBarButtonItem doesn't have a hidden property, and any examples I've found so far for hiding them involve setting nav bar buttons to nil, which I don't think I want to do here because I may need to show the button again (not to mention that, if I connect my button to an IBOutlet, if I set that to nil I'm not sure how I'd get it back). Save your button in a strong outlet (let's call it myButton ) and do this to add/remove it: // Get the

Is there a way to change the height of a UIToolbar?

佐手、 提交于 2019-11-26 19:37:46
I've got an UIToolbar in Interface Builder and I've noticed that it's locked to being 44px tall. Of course I'd like to make this larger. Does Apple allow resizing of this control? If so, how do I go about it? David Kanarek Sure, just set its frame differently: [myToolbar setFrame:CGRectMake(0, 50, 320, 35)]; This will make your toolbar 35 pixels tall. Of course this requires an IBOutlet or creating the UIToolbar programmatically, but that's very easy to do. If that does not work in SDK 6, it is possible to solve as below: Select the toolbar element and choose Editor > Pin > Height to create a

How to draw a transparent UIToolbar or UINavigationBar in iOS7

假装没事ソ 提交于 2019-11-26 19:15:49
I would like an entirely transparent UIToolbar and/or UINavigationBar . I have tried the various incantations suggested for pre- and post-iOS 5 but none seem to work any more. How might this be accomplished in iOS 7? Gabriele Petronella Swift 3 (iOS 10) Transparent UIToolbar self.toolbar.setBackgroundImage(UIImage(), forToolbarPosition: .any, barMetrics: .default) self.toolbar.setShadowImage(UIImage(), forToolbarPosition: .any) Transparent UINavigationBar self.navigationBar.setBackgroundImage(UIImage(), for: .default) self.navigationBar.shadowImage = UIImage() self.navigationBar.isTranslucent

InputAccessoryView docked at bottom

你说的曾经没有我的故事 提交于 2019-11-26 18:55:09
问题 I'm trying to achieve similar positioning behavior as the bottom text input bar in Apple's Messages app. I have tried many approaches, searched high and low and there are many similar questions but none have been satisfactory. To specify: There is a UIToolbar at the bottom of the view The toolbar is to follow the keyboard as the keyboard appears and disappears The toolbar should stay on top of the keyboard when the keyboard is visible When the keyboard is hidden, the toolbar stays ("docked")

Can I give a UIToolBar a custom background in my iPhone app?

ⅰ亾dé卋堺 提交于 2019-11-26 17:58:24
问题 Is it possible to give a UIToolBar a custom background from an image rather than the usual tinted blue/black fade out? I've tried giving the view a background and setting the opacity of the UIToolBar but that also affects the opacity of any UIBarButtons on it. 回答1: Answering my own question here!!! Overriding the drawRect function and creating an implementation of the UIToolbar does the trick :) @implementation UIToolbar (CustomImage) - (void)drawRect:(CGRect)rect { UIImage *image = [UIImage

Aligning UIToolBar items

∥☆過路亽.° 提交于 2019-11-26 17:34:42
问题 I have three UIBarButtonItem created as below. They align left and I'd like to align center so there isn't a gap on the right side. I don't see an align property on UIToolBar . Is there another way to accomplish this? //create some buttons UIBarButtonItem *aboutButton = [[UIBarButtonItem alloc] initWithTitle:@"About" style:UIBarButtonItemStyleBordered target:self action:@selector(showAbout:)]; [toolbar setItems:[NSArray arrayWithObjects:settingsButton,deleteButton,aboutButton,nil]]; //Add the