简体   繁体   English

如何以编程方式禁用按钮上的操作方法

[英]how to disable action method on a button click programmatically

I am developing a simple quiz game in which if a button is clicked then the player can have two chances to give answer. 我正在开发一个简单的问答游戏,其中如果单击一个按钮,则玩家可以有两次机会给出答案。 If first choice is right, then buttonClicked action will performed. 如果第一个选择正确,那么将执行buttonClicked操作。 If it is wrong then player can have second chance to give the answer. 如果错了,那么玩家可以有第二次机会给出答案。 if it is correct, buttonClicked will performed otherwise game over. 如果正确,buttonClicked将执行否则游戏结束。

please guide me how to perform this .. Any help will be highly appreciated.. 请指导我如何执行..任何帮助将不胜感激..

UIControll has property enabled . UIControll已启用属性

If the enabled state is NO, the control ignores touch events ... 如果启用状态为“否”,则控件将忽略触摸事件...

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM