Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hud在Debug View Hierarchy上显示和我页面显示的效果不同 #629

Open
bosszhu opened this issue Dec 16, 2021 · 4 comments
Open

Comments

@bosszhu
Copy link

bosszhu commented Dec 16, 2021

image
image
奇怪的现在,我的界面显示hud被tableview遮挡,但是我打开图层显示在最上方,而且不管怎么调整显示的window还是无法做到在最上层显示,求解决办法

@bosszhu
Copy link
Author

bosszhu commented Dec 16, 2021

- (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];
}

此处是相关代码

@dagundejuzi
Copy link

加个 [self.view bringSubviewToFront:progress]; 试试

@ZhangXueFei
Copy link

UIWindow *window = [UIApplication sharedApplication].windows.firstObject

@FadeFei
Copy link

FadeFei commented Aug 9, 2022

调用showProgress的上下文有么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants