开发者

MBProgressHUD tap to cancel, longer text?

开发者 https://www.devze.com 2023-04-10 14:54 出处:网络
I\'d like to use MBProgressHUD (or similar look) as alternative to default UIAlertView. I need a canceling capability on this view.

I'd like to use MBProgressHUD (or similar look) as alternative to default UIAlertView.

I need a canceling capability on this view.

I tried adding the following method to MBProgressHUD class but it didn't get called when touched.

Any idea?

(void) touchesEnded: (NSSet*) touches withEvent: (UIEvent*)event

I can't use gesture recognizer since my lowest target version is 3.1.2.

Also, it seems complex to enlarge label size for MBProgressHUD's te开发者_如何学Cxt.

Are there altanatives than fixing MBProgessHUD for the purpose?


I just had quick look at MBProgressHUD and would use that. First, change the size of the HUD by modifying layoutSubviews in MBProgressHUD.h. I would then create a new button class (UIButton subclass) and add this as a subview of the HUD.


This is a super old thread, but it would be way easier just to set hud's UserInteractionEnabled:YES and add a tapGestureRecognizer to it.

Cheers.

0

精彩评论

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

关注公众号