Open bosszhu opened 2 years ago
- (void)showProgress {
if(progress == nil) {
// progress = [[MBProgressHUD alloc] initWithView:self.view];
UIWindow *keyWindow;
keyWindow = [UIApplication sharedApplication].windows.lastObject;
progress = [[MBProgressHUD alloc] initWithWindow:keyWindow];
UIImageView * custom = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ic_progress_loading"]];
progress.customView = custom;
progress.detailsLabelText = @"加载中...";
progress.detailsLabelFont = [UIFont systemFontOfSize:14.0f];
// 设置模式
progress.mode = MBProgressHUDModeCustomView;
// 隐藏时候从父控件中移除
progress.removeFromSuperViewOnHide = YES;
[self.view addSubview:progress];
}
[progress show:YES];
[self startNewAnimation];
}
此处是相关代码
加个 [self.view bringSubviewToFront:progress]; 试试
UIWindow *window = [UIApplication sharedApplication].windows.firstObject
调用showProgress的上下文有么?
奇怪的现在,我的界面显示hud被tableview遮挡,但是我打开图层显示在最上方,而且不管怎么调整显示的window还是无法做到在最上层显示,求解决办法