uicontrolevents

Getting or setting the hit area of UIButtonTypeInfoLight

五迷三道 提交于 2019-12-05 02:06:40
问题 So it seems that the tappable area of an UIButton with the type of UIButtonTypeInfoLight is much larger than its frame. Because of this, I can not put a button right next to it, trying to tap it will tap the info button instead. _infoButton.frame = CGRectMake(0, 0, 40, height); _searchButton.frame = CGRectMake(CGRectGetMaxX(_infoButton.frame), 0, 40, height); Does anyone have any insite on how to get the tappable area of the button? Edit:having the button next the info button it is not my

UIButton UIControlEventTouchUpInside does not fire, but UIControlEventTouchDown does fire

我的未来我决定 提交于 2019-12-04 06:25:51
I am implementing UIButton and my UIControlEventTouchUpInside event does not fire, even though UIControlEventTouchDown does fire. UIButton *btnClose = [UIButton buttonWithType:UIButtonTypeCustom]; NSString *filePathImage = @"img.png"; NSString *filePathImageTap = @"img-tap.png"; UIImage *buttonImage = [UIImage imageWithContentsOfFile:filePathImage]; UIImage *buttonImageTap = [UIImage imageWithContentsOfFile:filePathImageTap]; [btnClose setImage:buttonImage forState:UIControlStateNormal]; [btnClose setImage:buttonImageTap forState:UIControlStateSelected]; [btnClose setImage:buttonImageTap

UIButton Highlighted State not showing when clicking over a Selected UIButton

心已入冬 提交于 2019-12-04 05:04:49
I want my UIButton to show up the highlighted state when I click over a button that is already selected. Basically in the highlighted state I apply a *.png image as my UIButton backgroundImage to give a pressed down effect. But if the button is already in the Selected State When I click over it again I just can't see the highlighted state but it goes straight to the normal state! Watch the Issue--> Video of the Issue! Help please //0 init UIButton UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x, y, aSide, aSide)]; //1 Give it a backgroundColor [button setBackgroundColor:aColor]

Getting or setting the hit area of UIButtonTypeInfoLight

偶尔善良 提交于 2019-12-03 20:40:07
So it seems that the tappable area of an UIButton with the type of UIButtonTypeInfoLight is much larger than its frame. Because of this, I can not put a button right next to it, trying to tap it will tap the info button instead. _infoButton.frame = CGRectMake(0, 0, 40, height); _searchButton.frame = CGRectMake(CGRectGetMaxX(_infoButton.frame), 0, 40, height); Does anyone have any insite on how to get the tappable area of the button? Edit:having the button next the info button it is not my core question (just an illustration of why it might be important). My question is about finding out the

How can I send a “UIControlEventValueChanged” event from my custom control?

会有一股神秘感。 提交于 2019-12-03 14:37:32
问题 I've created a custom picker view type of control by subclassing UIView. I would like to be able to send a "UIControlEventValueChanged" control event from within this control, so that I can register for it in whichever view controller is using the control. How can I can I get my custom control to trigger this event when I deem it should be triggered? 回答1: Assuming your custom control extends UIControl , then you simply do: [self sendActionsForControlEvents:UIControlEventValueChanged]; This

How can I send a “UIControlEventValueChanged” event from my custom control?

拥有回忆 提交于 2019-12-03 04:21:33
I've created a custom picker view type of control by subclassing UIView. I would like to be able to send a "UIControlEventValueChanged" control event from within this control, so that I can register for it in whichever view controller is using the control. How can I can I get my custom control to trigger this event when I deem it should be triggered? Assuming your custom control extends UIControl , then you simply do: [self sendActionsForControlEvents:UIControlEventValueChanged]; This will call all registered targets (via addTarget:action:forControlEvents: that this event has happened. 来源:

UIDatePicker bug? UIControlEventValueChanged after hitting minimum internal

♀尐吖头ヾ 提交于 2019-11-28 04:57:58
I've run into a weird effect that sure looks like a bug in iOS7 -- but often in the past, when I have thought I found a bug in Apple's APIs, it has turned out to be my own misunderstanding. I have a UIDatePicker with datePickerMode = UIDatePickerModeCountDownTimer and minuteInterval = 5. I initialize the duration to 1 hour, and present it to the user, where it appears as a two-column picker with hours and minutes. (So far so good.) The user is thinking "20 minutes," and so scrolls the Hour column to 0. At this point the picker reads 0 hours and 0 minutes, and iOS7 is not cool with that, so it

UIDatePicker bug? UIControlEventValueChanged after hitting minimum internal

落花浮王杯 提交于 2019-11-27 05:28:50
问题 I've run into a weird effect that sure looks like a bug in iOS7 -- but often in the past, when I have thought I found a bug in Apple's APIs, it has turned out to be my own misunderstanding. I have a UIDatePicker with datePickerMode = UIDatePickerModeCountDownTimer and minuteInterval = 5. I initialize the duration to 1 hour, and present it to the user, where it appears as a two-column picker with hours and minutes. (So far so good.) The user is thinking "20 minutes," and so scrolls the Hour

Passing parameters to addTarget:action:forControlEvents

梦想的初衷 提交于 2019-11-26 17:02:07
I am using addTarget:action:forControlEvents like this: [newsButton addTarget:self action:@selector(switchToNewsDetails) forControlEvents:UIControlEventTouchUpInside]; and I would like to pass parameters to my selector "switchToNewsDetails". The only thing I succeed in doing is to pass the (id)sender by writing: action:@selector(switchToNewsDetails:) But I am trying to pass variables like integer values. Writing it this way doesn't work : int i = 0; [newsButton addTarget:self action:@selector(switchToNewsDetails:i) forControlEvents:UIControlEventTouchUpInside]; Writing it this way does not

Passing parameters to addTarget:action:forControlEvents

我与影子孤独终老i 提交于 2019-11-26 04:59:28
问题 I am using addTarget:action:forControlEvents like this: [newsButton addTarget:self action:@selector(switchToNewsDetails) forControlEvents:UIControlEventTouchUpInside]; and I would like to pass parameters to my selector \"switchToNewsDetails\". The only thing I succeed in doing is to pass the (id)sender by writing: action:@selector(switchToNewsDetails:) But I am trying to pass variables like integer values. Writing it this way doesn\'t work : int i = 0; [newsButton addTarget:self action: