Dim background + interface orientation
rosik opened this issue · 6 comments
device rotation animation looks strange with dim background
Yep, the same problem here.
I just "hacked" MBProgressHUD.m file and added two new items to self.autoresizingMask:
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight
It should look like this:
self.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin
| UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin
| UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
Now it works. It should be added to this repository code... Matej?
Yeah, I should test things a bit more thoroughly when puling them in.
I'm aware of this issue, I just haven't found the time to get to it. Fixing this might require a different approach to centering altogether, perhaps even refracting the HUD view into two views (background and HUD bezel).
Borut, your solution fixes the background but causes the HUD bezel to stretch during rotation.
Oh, this is probably cos you are using drawRect method. You should probably call this method again (or relayout) on rotation change...
Borut, the view is redrawn to the new size, it's just that the flexible width/height autoresizing rules than cause the resized view to be first stretched back to the previous size and than animated to the new size.
The best solution that I see is this is to use a subview for the HUD bezel. This would also improve some other things and fix issues like #3. I have this on my todo list.
If you have a solution that works with the current drawRect: approach, than a pull request or patch would definitely be appreciated. :)
Understand. If I'll have time I'll try to check it out...