uicontrol

UIButton not calling action in iOS 5 but works in iOS 6

╄→гoц情女王★ 提交于 2019-12-03 02:36:56
I have a UIButton that is loaded from a xib file as an IBOutlet property of a view controller. I attach a selector to the button in the viewDidLoad of my view controller: [_myButton addTarget:self action:@selector(mySelector) forControlEvents:UIControlEventTouchUpInside]; In iOS 6 everything works, but when i run on the simulator in iOS 5.0 the selector doesn't get called. The button does highlight when it is touched. Another thing to note is that the button is in a UIView that has a UITapGestureRecognizer added to it. The UITapGestureRecognizer for this view gets called in iOS 5.0 when the

Can I use custom values of UIControlState for my own control?

十年热恋 提交于 2019-12-02 18:31:31
Is there a way to set a custom states -- not one of the existing UIControlState values -- for a UIControl ? In the UIControlSate enum, there are 16 bits that can be used for custom control states: UIControlStateApplication = 0x00FF0000, // additional flags available for application use The problem is that UIControl 's state property is readonly . I want to set different background images to my UIButton for custom states. You can make use of the custom states in a subclass of UIControl. Create a variable called customState in which you will manage your custom states. If you need to set a state,

Always show AVPlayer controls

扶醉桌前 提交于 2019-12-02 04:30:35
问题 I have an AVPlayerViewController with a AVPlayer in it, and what I need is that the controls of the player (play, pause, time slider) never hides. Right now after more or less 4 seconds of playing the video the become hidden, and you have to tap the screen to show them again. I haven't been able to find a solution to that.. any ideas? thx! 回答1: You can set that by using Key-Value Coding Swift: // playerController : AVPlayerViewController playerController.setValue(false, forKey:

Always show AVPlayer controls

自作多情 提交于 2019-12-02 01:31:24
I have an AVPlayerViewController with a AVPlayer in it, and what I need is that the controls of the player (play, pause, time slider) never hides. Right now after more or less 4 seconds of playing the video the become hidden, and you have to tap the screen to show them again. I haven't been able to find a solution to that.. any ideas? thx! You can set that by using Key-Value Coding Swift: // playerController : AVPlayerViewController playerController.setValue(false, forKey: "canHidePlaybackControls") 来源: https://stackoverflow.com/questions/39660095/always-show-avplayer-controls

Javafx slider value at mousemoved event

為{幸葍}努か 提交于 2019-12-02 01:16:44
问题 I am making a media player and am trying to get the playback slider value at the cursor position when hovering over the slider bar. In an attempt to do this, i have used the following: timeSlider.addEventFilter(MouseEvent.MOUSE_MOVED, event -> System.out.println("hovering")); which prints "hovering" whenever the mouse changes position over the slider. Can anyone please show me how to get the value of the slider at the current cursor position? I can only figure out how to get the value at the

Javafx slider value at mousemoved event

情到浓时终转凉″ 提交于 2019-12-01 20:47:14
I am making a media player and am trying to get the playback slider value at the cursor position when hovering over the slider bar. In an attempt to do this, i have used the following: timeSlider.addEventFilter(MouseEvent.MOUSE_MOVED, event -> System.out.println("hovering")); which prints "hovering" whenever the mouse changes position over the slider. Can anyone please show me how to get the value of the slider at the current cursor position? I can only figure out how to get the value at the thumb position. Thanks in advance. Here is a bit (maybe more than a bit) of a hack that works if you

Highlighting a UIControl subclass

大城市里の小女人 提交于 2019-12-01 02:59:54
basically I need an image button, specifically a custom object that: 1) calls a controller's action when tapped 2) encapsulates custom data 3) is automatically moved by wrapper view (not relevant) Well, I got all this with a subclass of UIControl (since subclassing UIButton is not recommended and subclassing UIImageView makes difficult to manage the point 1). But now what is the correct way to highlight it? I would like to highlight the control when tapped in any way (even a simple momentary reduction of alpha). With beginTrackingWithTouch and endTrackingWithTouch I can't recognize the only

How to animate transition from one state to another for UIControl/UIButton? [duplicate]

放肆的年华 提交于 2019-12-01 01:08:38
This question already has an answer here: Fading out an UIButton when touched 1 answer I have a UIButton that changes image on highlight. When transitioning from UIControlStateHighlight to UIControlStateNormal, I want the highlighted image to slowly fade back into the normal image. Is there an easy way to do this? I ended up subclassing UIButton. Here's the implementation file code. I took some app-specific stuff out, so I haven't tested this exact code, but it should be fine: #import "SlowFadeButton.h" @interface SlowFadeButton () @property(strong, nonatomic)UIImageView *glowOverlayImgView; /

Highlighting a UIControl subclass

删除回忆录丶 提交于 2019-11-30 21:55:48
问题 basically I need an image button, specifically a custom object that: 1) calls a controller's action when tapped 2) encapsulates custom data 3) is automatically moved by wrapper view (not relevant) Well, I got all this with a subclass of UIControl (since subclassing UIButton is not recommended and subclassing UIImageView makes difficult to manage the point 1). But now what is the correct way to highlight it? I would like to highlight the control when tapped in any way (even a simple momentary

UI_06 UIControl及其子类

巧了我就是萌 提交于 2019-11-30 20:40:26
⼀、UISegmentedControl的使⽤ 分段控件。每个segment都能被点击,相当于集成了若干个button。 通常我们会点击不同的segment来切换不同的view。 1、常⽤⽅法和属性 initWithItems: //UISegmentedControl独有的初始化⽅法,⽤来创建多个分段 setTitle: forSegmentAtIndex: //为指定下标的分段设置title selectedSegmentAtIndex //(property)被选中的segment tintColor //(property)segmentedControl条的颜⾊(含每个segment的颜⾊) addTarget: action: forControlEvents://给UISegmentedControl添加事件, controlEvent //为UIControlEventValueChanged。 2、使用 RootViewController.m #import "RootViewController.h" #import "MessageViewController.h" #import "PhoneViewController.h" @interface RootViewController () @property ( nonatomic , retain )