开发者

UIButton event "touch hold"

开发者 https://www.devze.com 2023-03-10 13:10 出处:网络
in Xcode 3.2 Interface Builder there was a UIButton Send Event called \"touch hold\". This very simply executed the event as long as the button was being held. For example lets say you had a red light

in Xcode 3.2 Interface Builder there was a UIButton Send Event called "touch hold". This very simply executed the event as long as the button was being held. For example lets say you had a red light and UIButton t开发者_开发问答hat lit up the light. The "touch hold" send event would keep the light lit the while the button was being pushed but when the user took his finger off the button, the light would turn off. Does anyone know what happened to this event and how to implement it in xcode 4.0 preferably in Interface Builder like xcode 3.2.


Making your own seems to be the easiest route. Create two IBActions, one that turns your red light off, and one that turns your red light on.

In interface builder, connect the button's "touch Down" send event to the IBAction turning on your light. Then connect the button's "touch Up Inside" send event to the IBAction turning off your light.


In iPad iOS 7 touch down method does not work properly.

Multitasking is enabled from setting.(4 finger multitasking).

0

精彩评论

暂无评论...
验证码 换一张
取 消