Is there a way to make the MBProgressHUD show at the bottom or top of the screen?
I have tried setting the frame using [hud setFrame:....];
, initWithFrame
, and setting thecenter
property of the hud. None of these worked. I did an NSLog() of the frames after trying these methods. The values had changed but the hud still displayed at the center of the screen.
A thing to note, the hud is displayed using a UIWindow:
UIWindow *window = [[[UIApplication sharedApplication] windows] lastObject];
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:window animated:YES];
hud.mode = MBProgressHUDModeText;
hud.labelText = @"some text";
Did this because the hud is displayed by a background execution block, thus the hud could be displayed on any view currently in display.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…