uitoolbar

How to drag a label and drop on UIToolbarItem in iphone

梦想与她 提交于 2020-01-05 10:30:53
问题 I am facing problem to drag and drop UILabel . How to drag label(Move This) and drop on any one of UIToolBar item (i.e., 1 or 2 or 3 ...) that button title should change as label text. Check image for this question 回答1: Use custom button as a label and then use this code as : UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button addTarget:self action:@selector(btnTouch:withEvent:) forControlEvents:UIControlEventTouchDown]; button.tag = -1; button.titleLabel.text = @"Move

uinavigationController's toolbar with custom items

我怕爱的太早我们不能终老 提交于 2020-01-03 02:30:12
问题 I am trying to use the NavigationController's toolbar in my app. This toolbar's toolbarItems are suppose to change depending on which view controller is presented. this is very basic. What I am trying to do is to add custom buttons to the toolbar using the UIBarButtonItem's "initWithCustomView:" method. However, the button won't show up on the toolbar. But if I create the UIBarButtonItem using the "initWithTitle:" or "initWithBarButtonSystemItem:" method, the button show up. For example, look

Adjust width of UITextField to fill toolbar in landscape

爱⌒轻易说出口 提交于 2020-01-02 03:40:27
问题 In a UIToolbar , I have added a UITextField to the middle of the bar (which gets added as a UIBarButtonItem ) with another UIBarButtonItem (Action button) next to it. I added flexible space bar button items at the very left and very right. It looks great on portrait, but when I rotate to landscape it centers them and looks ok, but I need the text field to get stretched to fill the width and push the last button clear to the right - exactly like it does in Messages - on iPhone and iPad. I

programmatically stop uipickerview animation on iphone

有些话、适合烂在心里 提交于 2020-01-01 09:24:20
问题 I have a UIActionSheet containing a picker and a UIToolbar. On the UIToolBar there is a save button. However, some of my users reported pressing the save button before the UIPickerView stops spinning thus only retrieving the initial value (before spinning). Is there a way to get the currently selected item of the UIPickerView once the user taps save or get feedback of the active selected item while it's spinning? Thanks 回答1: Even if they dismiss the picker while it's still spinning, the

UIToolbar on each page of UINavigationController

为君一笑 提交于 2019-12-31 21:43:11
问题 I have an application which runs on a UINavigationController. Now I would like to add a UIToolbar element to the bottom of each screen. The Toolbar on the bottom should the be customizable for the ViewController that is currently being displayed. My first idea was to simply add the toolbar to the navigationController view and tag it, in the viewController I thought I would then be able to retrieve the UIToolbar element. I have the following code: In my AppDelegate: // Get instance of Toolbar

UIToolbar xib xcode

半腔热情 提交于 2019-12-31 04:10:12
问题 I am trying to create a custom UIToolbar that I can add to multiple views, I don't want to do this programmatically so I am using xib to design a UIToolbar. Do I need to wrap this in a UIView and a View Controller? ViewController.m is the root view controller. This is just a simple project I am just trying out some stuff 回答1: You can do this so: create ToolBar.xib file, delete UIView and add UIToolbar create ToolBar.swift file, add code, like shown, and make outlets for .xib in "Identity and

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

与世无争的帅哥 提交于 2019-12-28 01:42:12
问题 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

UIButton hidden behind UIToolbar

谁说我不能喝 提交于 2019-12-25 17:45:22
问题 Context I've got a UIButton that I'm adding, method is below: [self.view addSubview:[self returnCustomSubmitButton]]; I don't add the toolbar as a subview, I set the ViewControllers navigationController property toolBarHidden to NO. - [self.navigationController setToolbarHidden:NO animated:NO]; at viewWill apear Extra Detail The reason I'm doing this is because I want to create something like the toolbar (NOTE: This is a UITabBar, but I'm looking for the same shape) below - so I'm adding a

UIBarButtonItem not reacting after click

家住魔仙堡 提交于 2019-12-25 10:04:04
问题 From the rootViewController I navigate to a UIViewController if (self.contr == nil) { ExampleViewController *controller = [[ExampleViewController alloc] initWithNibName:@"Example" bundle:[NSBundle mainBundle]]; self.contr = controller; [controller release]; } [self.navigationController presentModalViewController:self.contr animated:YES]; In the UIViewController I have the method -(IBAction) goBack:(id)sender { [self.navigationController dismissModalViewControllerAnimated:YES]; } I added the

UIBarButtonItem not reacting after click

前提是你 提交于 2019-12-25 10:03:33
问题 From the rootViewController I navigate to a UIViewController if (self.contr == nil) { ExampleViewController *controller = [[ExampleViewController alloc] initWithNibName:@"Example" bundle:[NSBundle mainBundle]]; self.contr = controller; [controller release]; } [self.navigationController presentModalViewController:self.contr animated:YES]; In the UIViewController I have the method -(IBAction) goBack:(id)sender { [self.navigationController dismissModalViewControllerAnimated:YES]; } I added the