使用特定标签禁用 UIButton [英] Disable UIButton with a specific tag

查看:43
本文介绍了使用特定标签禁用 UIButton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用带有特定标签的按钮,我尝试使用以下代码:

I want to disable a button with a specific tag, I try this code:

UIButton *button = (UIButton *)[self.view viewWithTag:33];
[button setEnabled:FALSE];

但它不起作用,为什么?

but It don't work, why?

推荐答案

尝试调试,看看有没有按钮地址.最坏的情况,您也可以尝试使用 NO,而不是 FALSE.

Try to debug and see if there is an address for the button. Worst case, u can also try using NO, instead of FALSE.

这篇关于使用特定标签禁用 UIButton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆