ibaction

How to hide tab bar with animation in iOS?

我是研究僧i 提交于 2019-11-27 10:39:18
So I have a button that is connected to a IBAction. When I press the button I want to hide the tab bar in my iOS app with a animation. This [self setTabBarHidden:hidden animated:NO]; or this [self.tabBarController setTabBarHidden:hidden animated:YES]; does not work. This is my code without the animation: - (IBAction)picture1:(id)sender { [self.tabBarController.tabBar setHidden:YES]; } Any help would be greatly appreciated :D lara I try to keep view animations available to me using the following formula: // pass a param to describe the state change, an animated flag and a completion block

UIButton event 'Touch Up Inside' not working. 'Touch Down' works fine

ぃ、小莉子 提交于 2019-11-27 02:48:31
问题 I've got a UIButton in a UIView, which is in a UIViewController that I've allocated and inited from a .xib file. When hooking an IBAction up to the 'Touch Down' event of a UIButton it triggers correctly. But if I hook it up to the 'Touch Up Inside' event it doesn't respond. Other events don't work either. 'Touch Drag Enter', 'Touch Drag Exit', 'Touch Up Outside' etc. Only Touch Down. Does anyone have any idea why this might be? The button is a simple rounded rectangle button in a view

UIButton events. What's the difference?

*爱你&永不变心* 提交于 2019-11-27 02:45:56
I've encountered a problem where my button should remain "pressed down" while it shows popover called from it. Popover is selector for some filter and filter is shown on button itself. When I tap on it and it shows popover it becomes deselected no matter what. I think I have to redefine it's behavior on touch event and make it respond not to standart touch up inside . Then I wondered what are other events responsible for? But I couldn't find events list in iOS library and in StackOverflow are only questions about incorrect behavior of touch up inside or touch down . So what's the difference

Pass different parameters to an IBAction

十年热恋 提交于 2019-11-27 01:38:59
问题 My iPhone app has many buttons and I want all the buttons to call the same method, but with different parameters. For example I want tapping one button to call the method myMethod: with the argument @"foo" , and a second button should call the same method but with argument @"bar" . 回答1: The so called "IBActions" must have one of these signatures: -(void)action; -(void)actionWithSender:(id)sender; -(void)actionWithSender:(id)sender event:(UIEvent*)event; You cannot add any other parameters.

Objective C: what is a “(id) sender”?

六月ゝ 毕业季﹏ 提交于 2019-11-27 01:16:50
In some IBAction I saw: - (IBAction)pushButton:(id)sender; This (id)sender when do I use it? (id)sender is the object which sent the message to that selector. Code example: - (IBAction)submitButton:(id)sender { UIButton *button = (UIButton *)sender; [button setEnabled:NO]; [button setTitle:@"foo" forState:UIControlStateDisabled]; } Ahmad Kayyali Matt Galloway described the meaning of (id) sender in actions on the iPhone Dev SDK forums thusly: (id)sender is the object which sent the message to that selector. It's like in the delegate functions where you have the control passed in to the

How to hide tab bar with animation in iOS?

霸气de小男生 提交于 2019-11-26 22:15:30
问题 So I have a button that is connected to a IBAction. When I press the button I want to hide the tab bar in my iOS app with a animation. This [self setTabBarHidden:hidden animated:NO]; or this [self.tabBarController setTabBarHidden:hidden animated:YES]; does not work. This is my code without the animation: - (IBAction)picture1:(id)sender { [self.tabBarController.tabBar setHidden:YES]; } Any help would be greatly appreciated :D 回答1: I try to keep view animations available to me using the

Can you hard code IBActions and IBOutlets, rather than drag them manually in Interface Builder?

一世执手 提交于 2019-11-26 20:43:42
问题 Is it possible to to hard code the IBAction s and IBOutlet s in code, instead of drag-connecting them in Interface Builder? 回答1: Yes it is poosible... sample code UIButton *btnDetail = [UIButton buttonWithType:UIButtonTypeRoundedRect] ; [btnDetail setFrame:CGRectMake(250.0f, 15.0f, 65.0f, 20.0f)] ; //btnDetail.backgroundColor = [UIColor grayColor]; [btnDetail setTitle:@"Detail" forState:UIControlStateNormal]; [btnDetail setTitleColor: [UIColor redColor] forState: UIControlStateNormal];

Gesture recognizer and button actions

余生颓废 提交于 2019-11-26 12:40:57
I have a view hierarchy that looks something like this: UIView (A) UIView > UIImageView UIView > UIView (B) UIView > UIView (B) > Rounded Rect Button UIView > UIView (B) > UIImageView UIView > UIView (B) > UILabel I've attached gesture recognizer(s) to my UIView (B). The problem that i'm facing is that i don't get any actions for the Rounded Rect Button which is inside the UIView (B). The singleTap gesture recognizer captures/overrides the button's Touch Up Inside event. How can i make it work? I thought that the responder chain hierarchy will make sure that the button touch event will be

Objective C: what is a “(id) sender”?

故事扮演 提交于 2019-11-26 09:39:13
问题 In some IBAction I saw: - (IBAction)pushButton:(id)sender; This (id)sender when do I use it? 回答1: (id)sender is the object which sent the message to that selector. Code example: - (IBAction)submitButton:(id)sender { UIButton *button = (UIButton *)sender; [button setEnabled:NO]; [button setTitle:@"foo" forState:UIControlStateDisabled]; } 回答2: Matt Galloway described the meaning of (id) sender in actions on the iPhone Dev SDK forums thusly: (id)sender is the object which sent the message to

Gesture recognizer and button actions

牧云@^-^@ 提交于 2019-11-26 03:03:23
问题 I have a view hierarchy that looks something like this: UIView (A) UIView > UIImageView UIView > UIView (B) UIView > UIView (B) > Rounded Rect Button UIView > UIView (B) > UIImageView UIView > UIView (B) > UILabel I\'ve attached gesture recognizer(s) to my UIView (B). The problem that i\'m facing is that i don\'t get any actions for the Rounded Rect Button which is inside the UIView (B). The singleTap gesture recognizer captures/overrides the button\'s Touch Up Inside event. How can i make it