GitHub:https://github.com/zacaltman/ZAActivityBar
ZAActivityBar和SVProgressHUD非常相似,它提供了更加简洁的API来显示提示效果。
显示加载状态:
1 | [ZAActivityBar showWithStatus:@"加载中..."]; |
显示成功、失败状态:
1 2 | [ZAActivityBar showSuccessWithStatus:@"成功!"]; [ZAActivityBar showErrorWithStatus:@"失败!"]; |
隐藏提示:
1 | [ZAActivityBar dismiss]; |
相关代码:
- (IBAction)showText:(id)sender {
//不会自己消失
[ZAActivityBar showWithStatus:@"hello"];
}
- (IBAction)dismiss:(id)sender {
[ZAActivityBar dismiss];
}
- (IBAction)showSuccess:(id)sender {
//自动消失
[ZAActivityBar showSuccessWithStatus:@"success"];
}
- (IBAction)showError:(id)sender {
//自动消失
[ZAActivityBar showErrorWithStatus:@"error"];
}
- (IBAction)showImage:(id)sender {
//自动消失
[ZAActivityBar showImage:[UIImage imageNamed:@"Default"] status:@"default"];
}