MBProgressHUD

2017年4月26日
一.页面跳转正确使用弹框
1.如果是push页面的,一定要在页面加载好后,在使用弹框。

if (_examType == HuExamTypeExam) {
            //先push页面,在添加弹框
            [weakSelf enterTestResultPage:resExerciseModel];
            if (isTimeOut) {
                [MBProgressHUD showMessageInCurrentWindow:@"考试开始后超过考试时长,自动结束考试"];
            }
        }

不然就会一直不消失(不是必现,偶尔也有正常的)。

Paste_Image.png

或者可以用如下方法,添加页面前先用弹框显示,点击确定后在添加页面

- (void)showAlertMore {

    NSString *msg = [NSString stringWithFormat:@"您已退出界面%ld次,已经自动交卷啦",_leaveTimes];
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:msg preferredStyle:UIAlertControllerStyleAlert];

    WS(weakSelf);
    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
        weakSelf.blackView.hidden = true;
        [weakSelf.navigationController setNavigationBarHidden:false];

        [weakSelf uploadPaper:NO];//大于n次 自动提交答案

    }];

    [alertController addAction:cancelAction];
    [self presentViewController:alertController animated:YES completion:nil];
}

2.如果是pop页面可以先 弹框, 在pop页面

{
            // 提示 在跳转到详情即可
            NSString *message = [NSString stringWithFormat:@"全部%@题,正确%@题",resExerciseModel.total,resExerciseModel.successCount];
            [MBProgressHUD showMessageInCurrentWindow:message];
            [HuConfigration curVc:weakSelf backToSpecialVCClass:kTrainingDetailViewController first:YES];
        }

2017年4月10日
1.使用

[MBProgressHUD showMessage:@"请输入姓名"];
[MBProgressHUD showMessageInCurrentWindow:message];

如果您发现本文对你有所帮助,如果您认为其他人也可能受益,请把它分享出去。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容