1

Is it possible to show a BTProgressHUD with a mask without preventing interaction with the tab bar? In other words, can the mask on a BTProgressHUD be constrained to just the tab's currently shown view controller instead of the full window?

BTProgressHUD.Show(status: "Oh hai", maskType: ProgressHUD.MaskType.Gradient);

BTProgressHUD mask blocks the ability to switch tabs.

I am trying to swap out MTMBProgressHUD for BTProgressHUD (because reasons). Unfortunately, when I show a BTProgressHUD with a mask, it will block the user from selecting another tab while it is shown (something MTMBProgressHUD didn't prevent). I definitely need to block any progression/interaction within the current tab's view controller, but I don't mind if the user switches to another tab instead of waiting for the current tab to complete whatever task is requiring the progress HUD.

Here is the full sample code Gist. It is a bit more complex since it includes the tab bar controller and each tab needs to be able to control their own individual HUDs (when this issue is resolved).

patridge
  • 26,385
  • 18
  • 89
  • 135
  • Didn't work with BTProgressHUD for a while, but as far as I can remember it lives out of the box fullscreen on the main window. But as the code is available on GitHub you could easily change that. Quick check at https://github.com/nicwise/BTProgressHUD/blob/master/BTProgressHUD/ProgressHUD.cs: lines 240 & 241 look interesting. – asp_net Feb 05 '15 at 19:59
  • That was what the BTProgressHUD creator was suggesting on Twitter as well. Thanks for the line numbers, though. I hadn't made it that far yet. – patridge Feb 05 '15 at 20:32

1 Answers1

1

After some discussion on Twitter with the creator of BTProgressHUD, it was determined this isn't possible in the current v1.15 release. He suggesting modifying the source to make this happen. I was able to put together the a working version in just a few lines. (It would still need work to integrate with the BTProgressHUD.Show methods that use a shared instance, but I need discrete HUDs per tabs.)

If you build from this fork, you can then create a BTProgressHUD with a parent view (vs. defaulting to the window) which will restrict the coverage of the overlay mask.

var progressHud = new ProgressHUD(View); // ctor overload requires the forked version
progressHud.Show(status: labelText, maskType: ProgressHUD.MaskType.Gradient);

Animated GIF showing tab switching while a HUD is shown

patridge
  • 26,385
  • 18
  • 89
  • 135