jdg / MBProgressHUD

MBProgressHUD + Customizations
http://www.bukovinski.com/
MIT License
16.01k stars 3.56k forks source link

Hud (sometimes) shows a button with empty title on its own. #561

Closed alperkayabasi closed 4 years ago

alperkayabasi commented 5 years ago

I don't set a target or anything. Only code I called is [MBProgressHUD showHUDAddedTo:self.view animated:YES]

image

yanqiuLove commented 5 years ago

[hud.button removeTarget:nil action:nil forControlEvents:UIControlEventAllEvents];

roarapps commented 5 years ago

[hud.button removeTarget:nil action:nil forControlEvents:UIControlEventAllEvents];

Doesn't remove it.

Also have same issue

yanqiuLove commented 5 years ago

[hud.button removeTarget:nil action:nil forControlEvents:UIControlEventAllEvents];

不删除它。

也有同样的问题

You'll need to check if any of the other third-party libraries have added methods to their hud objects, and you'll want to use this method first:

hud. Button. Hidden = YES; [hud. Button removeTarget: nil action: nil forControlEvents: UIControlEventAllEvents];

If this method can not solve your problem, you can also use traverse all child controls of the hud object, find MBProgressHUDRoundedButton object, and then use : [button removeTarget: nil action: nil forControlEvents: UIControlEventAllEvents];

At present, I can think of only these two methods. If you have a better solution, I hope we can communicate with each other~

roarapps commented 5 years ago

Thank You! hud. Button. Hidden = YES; seems to have done the trick. Not sure what is setting it to true in the first place :(

alperkayabasi commented 5 years ago

@roarapps The thing is, I don't know why we need to set button.hidden = YES in the first place. It should already be hidden if you don't set a target. And using that code means we need to keep a variable for every HUD we use.

That's not a great solution. I stopped using this framework for now.

matej commented 4 years ago

This should be fixed now. See https://github.com/jdg/MBProgressHUD/issues/587.