开发者

Disable touch events while processing

开发者 https://www.devze.com 2022-12-16 11:49 出处:网络
I have a button which should not be clicked by user, when some processing is going on [shown using UIActivityIndicatorView].

I have a button which should not be clicked by user, when some processing is going on [shown using UIActivityIndicatorView].

For this when the processing starts i call [[UIApplication sharedapplication] beginIgnoringInteractionEvents];

and when processing ends i call [[UIApplication sharedApplication] endIgnoringInteractionEvents];

If i click the button during processing, touch event does not get called, but it gets called as soon as the processing st开发者_如何学运维ops.

Why is this happening?


try disabling the button instead.

[self.yourbutton setEnabled:FALSE];

0

精彩评论

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