【问题标题】:how to check is a button still pressed (clicked) or not?如何检查按钮是否仍被按下(单击)?
【发布时间】:2011-05-11 09:46:14
【问题描述】:

我需要知道此时按钮的状态是否被点击?

谢谢

【问题讨论】:

    标签: iphone objective-c cocoa-touch ipad uikit


    【解决方案1】:
    if (myButton.state & UIControlStateHighlighted) {
       // Do your stuff the user is currently holding down her finger…
    }
    

    【讨论】:

      【解决方案2】:

      查看 UIButton 的 state 属性。你对 UIControlStateHighlighted 感兴趣。

      【讨论】:

        猜你喜欢
        • 2020-01-02
        • 1970-01-01
        • 2014-05-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-03-08
        • 1970-01-01
        相关资源
        最近更新 更多