SVProgressHUD
2015-08-07 15:17
525 查看
github:https://github.com/TransitApp/SVProgressHUD
github下载的资源中有详细的使用方法。完全可以自定义包括后置背景颜色、前置颜色、字体的
大小、成功时的图片、错误时的图片、信息图片等,很好用。
从效果来看SVProgresssHUD 使用了单例的方法,自定义属性之后,所有的显示风格都是之前自定义的。
以下几乎全是从demo中抄来的…..
github下载的资源中有详细的使用方法。完全可以自定义包括后置背景颜色、前置颜色、字体的
大小、成功时的图片、错误时的图片、信息图片等,很好用。
从效果来看SVProgresssHUD 使用了单例的方法,自定义属性之后,所有的显示风格都是之前自定义的。
以下几乎全是从demo中抄来的…..
-(IBAction)dismissSV :(id)sender { [SVProgressHUD dismiss]; } -(IBAction)showWithStatus :(id)sender { // SVProgressHUDMaskTypeNone = 1, // allow user interactions while HUD is displayed // SVProgressHUDMaskTypeClear, // don't allow user interactions // SVProgressHUDMaskTypeBlack, // don't allow user interactions and dim the UI in the back of the HUD // SVProgressHUDMaskTypeGradient [SVProgressHUD showWithStatus:@"玩命加载中..." maskType:SVProgressHUDMaskTypeBlack]; [self performSelector:@selector(dismissSV:) withObject:nil afterDelay:0.5f]; } static float progress = 0.0f; -(IBAction)showWithProgress :(id)sender { progress=0.0f; [SVProgressHUD showProgress:progress status:@"加载中" maskType:SVProgressHUDMaskTypeBlack]; } - (void)increaseProgress { progress+=0.1f; [SVProgressHUD showProgress:progress status:@"Loading"]; if(progress < 1.0f) [self performSelector:@selector(increaseProgress) withObject:nil afterDelay:0.3f]; else [self performSelector:@selector(dismiss) withObject:nil afterDelay:0.4f]; } -(IBAction)showSV :(id)sender { [SVProgressHUD show]; [self performSelector:@selector(dismissSV:) withObject:nil afterDelay:0.5f]; } -(IBAction)showInfoWithStatus :(id)sender { [SVProgressHUD setBackgroundColor:[UIColor greenColor]]; [SVProgressHUD setForegroundColor:[UIColor orangeColor]]; [SVProgressHUD setCornerRadius:5]; [SVProgressHUD showInfoWithStatus:@"Useful Information" maskType:SVProgressHUDMaskTypeClear]; [self performSelector:@selector(dismissSV:) withObject:nil afterDelay:0.5f]; } -(IBAction)showSuccessWithStatus:(id)sender { [SVProgressHUD showSuccessWithStatus:@"Great Success!" maskType:SVProgressHUDMaskTypeGradient]; [self performSelector:@selector(dismissSV:) withObject:nil afterDelay:0.5f]; } -(IBAction)showErrorWithStatus:(id)sender { [SVProgressHUD showErrorWithStatus:@"出错了" maskType:SVProgressHUDMaskTypeClear]; [self performSelector:@selector(dismissSV:) withObject:nil afterDelay:0.5f]; }
相关文章推荐
- VC6使用GDI+的配置方法
- 如何使用Dialog Framework?
- 数组的定义声明,引用传递,及拷贝操作
- 如何在Linux下安装Erlang
- Mark Knowledge of Java Thread (1): Join Method
- LIstView超过字符显示省略号
- usb固件深入
- http和socket之长连接和短连接区别
- CSS的单位及css3的calc()及line-height百分比
- Jquery 校验插件
- Android 一个代码教你学会运用服务相关知识
- shen
- 企业通过CMMI5级评估之后应当做什么?EPG如何还能为企业带来更大价值?
- unity, change parent and keep localPosition or worlPosition
- 存储架构设计思考
- HDU 4666 Hyperspace(最长曼哈顿距离)
- hdu 5358 First One 数学
- HTML 5
- HDU5630 Hiking(贪心+优先队列)
- iOS混合编程之使用Swift+Objective-C调用WebService