简体   繁体   English

如何检查是否仍按下(点击)按钮?

[英]how to check is a button still pressed (clicked) or not?

I need to know the state of the button at this time if clicked or not ? 如果点击或不点击,此时我需要知道按钮的状态?

thanks 谢谢

take a look at the state property of your UIButton. 看看你的UIButton的州财产。 You're interested in UIControlStateHighlighted. 您对UIControlStateHighlighted感兴趣。

if (myButton.state & UIControlStateHighlighted) {
   // Do your stuff the user is currently holding down her finger…
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查是否在iPhone应用程序中单击了任何按钮 - how to check that any of the button is clicked or not in iphone application iphone dev如何检查按下通知的启动按钮 - iphone dev how to check notification's launch button pressed 如何检查是否按下了“破坏性”按钮(UIActionSheet - iPhone)? - How do I check if the 'destructive' button was pressed (UIActionSheet - iPhone)? 如何检查iPhone中的“主页”按钮是否被按下并采取相应措施? - How to check whether the Home button is pressed in iPhone and act accordingly? 是否可以检查是否按下完成按钮 - Is it possible to check if done button is pressed 如何在“带有标签的UITextField”上检查按下/触摸或单击了哪个Textfield标签的值? - How to Check the Value on “UITextField with tag” that which Textfield tag is pressed/Touch or Clicked? 如何检查是否没有点击任何按钮,那么它应该显示警报 - how to check if any of the button is not clicked then it should show alert 如何检查单击的按钮标题是否等于uiimageview中的图像名称 - How to check the clicked button title is equal to the image name in uiimageview 如何检查文本字段中是否有文本并单击按钮 - How to check whether there is text in text field and button is clicked 无论如何检查UINavigationBar按钮点击? - is there anyway to check UINavigationBar Button clicked?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM