美文网首页
IOS 开发之提示框显示

IOS 开发之提示框显示

作者: 本客 | 来源:发表于2019-11-01 16:45 被阅读0次

刚才写了一个加载转圈动画,现在提示框也记录一下吧,我简单的用了一个类方法的封装

+ (void)blockStyleWithText:(NSString*)string view:(UIView*)view{

    [MBProgressHUD hideHUDForView:view animated:YES];

    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];

    hud.animationType = MBProgressHUDAnimationZoomOut;

    hud.detailsLabel.text= string;

    hud.detailsLabel.font= [UIFont systemFontOfSize:15.0];

    hud.contentColor= [UIColor whiteColor];

    hud.square=NO;

    hud.mode = MBProgressHUDModeCustomView;

    hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;

    hud.bezelView.backgroundColor = [RCTool makeColorByString:@"#3A3A3A"];

    //    hud.backgroundView.backgroundColor = [RCTool makeColorByString:@"#000000"];

    //    hud.backgroundView.alpha = 0.3;

    [hud hideAnimated:YES afterDelay:1.5];

}

也是记得在主线程调用此方法

dispatch_async(dispatch_get_main_queue(), ^{

        [RCToast blockStyleWithText:messageview:self.view];

    });

相关文章

网友评论

      本文标题:IOS 开发之提示框显示

      本文链接:https://www.haomeiwen.com/subject/zuqqbctx.html