开发者

cannot disable UIButton

开发者 https://www.devze.com 2023-01-27 16:41 出处:网络
I have UIView > UIView > Custom UIButton with a simple image. It is a refresh button that I need to hide while I am downloading and processing the xml file, so the user is not able to trigger the refr

I have UIView > UIView > Custom UIButton with a simple image.

It is a refresh button that I need to hide while I am downloading and processing the xml file, so the user is not able to trigger the refresh multiple times.

This is the code I use to do that:

self.myRefreshButton.enabled = NO;

self.myRefreshButton.userInteractionEnabled = NO;

[self.myRefreshButton removeFromSuperview];

Unfortunately, it does not work. Although the button is removed, I am able to touch and trigger the button.

Any ideas w开发者_JAVA百科hat I am doing wrong?


I'd guess you forgot to link the button the your myRefreshButton property in Interface Builder. Check your connections there.

0

精彩评论

暂无评论...
验证码 换一张
取 消