刚才写了一个加载转圈动画,现在提示框也记录一下吧,我简单的用了一个类方法的封装
+ (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];
});
网友评论