长按UIButton
我想知道如果我能抓住一个事件(通过通知或其他机制),一个UIButton如果有人按住UIButton键过长的时间; 比单button更长的时间 – 比方说按住button几秒钟的人…
谢谢。
您可以将UILongPressGestureRecognizer
添加到button中,在其initWithTarget:action:
传递一个select器,并通过设置其minimumPressDuration
属性来select持续时间。
我想知道如果我能抓住一个事件(通过通知或其他机制),一个UIButton如果有人按住UIButton键过长的时间; 比单button更长的时间 – 比方说按住button几秒钟的人…
谢谢。
您可以将UILongPressGestureRecognizer
添加到button中,在其initWithTarget:action:
传递一个select器,并通过设置其minimumPressDuration
属性来select持续时间。