Position MBProgressHUD at the Bottom/Top of the screen

前端 未结 5 1132
醉话见心
醉话见心 2020-12-17 21:28

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:....];, initW

5条回答
  •  -上瘾入骨i
    2020-12-17 22:15

    I had the same trouble with a SVProgressHUD turns out I just had to add a new method

    + (void)setOffsetFromCenter:(UIOffset)offset {
    [self sharedView].offsetFromCenter = offset;
    }
    

    and call it when I showed the HUD

    [SVProgressHUD setOffsetFromCenter:UIOffsetMake(0, 120)];
    

    Mine just had to go a bit lower than mid-screen. Try it out, its a SingleTon so it's easier to call show and remove.

提交回复
热议问题