MBProgressHUD的基本用法
来源:互联网 发布:大路口车流量数据 编辑:程序博客网 时间:2024/06/07 05:01
////创建MBProgressHUD提示
-(void)MBProgressHUD{
///////1/// self指的是HUD要显示在那个view上
// //方式1.直接在View上show
// MBProgressHUD* HUD = [MBProgressHUD showHUDAddedTo:self animated:YES];
// //常用的设置
// //小矩形的背景色
// HUD.color = [UIColor clearColor];//这儿表示无背景
// //显示的文字
// HUD.labelText = @"发送消息成功";
// //细节文字
// HUD.detailsLabelText = @"socket消息";
// //是否有庶罩
// HUD.dimBackground = YES;
// [HUD hide:YES afterDelay:5];
////2//只显示文字
MBProgressHUD *hud = [MBProgressHUDshowHUDAddedTo:selfanimated:YES];
hud.mode =MBProgressHUDModeText;//显示的模式
hud.labelText =@"发送消息成功";
hud.labelColor=[UIColorredColor];
hud.margin =10.f;//文字和背景的距离
hud.yOffset =200.f;//整个MBView的Y的位置(起点位置是在view的中心附近)
hud.xOffset=10.0;//整个MBView的X的位置
hud.removeFromSuperViewOnHide =YES;
[hud hide:YESafterDelay:2];
///3/////
//方式2.initWithView
//use block
// MBProgressHUD* HUD = [[MBProgressHUD alloc] initWithView:self];
// [self addSubview:HUD];
// HUD.labelText = @"发送消息成功";
// HUD.mode=MBProgressHUDModeAnnularDeterminate;//模式带小圆圈
// [HUD showAnimated:YES whileExecutingBlock:^{
// sleep(3);
// } completionBlock:^{
//
// }];
// 3// 水平进度条
// MBProgressHUD* HUD = [[MBProgressHUD alloc] initWithView:self];
// [self addSubview:HUD];
// HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;//水平进度条
// HUD.labelText = @"发送消息成功";
// [HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES];
///4 // //自定义view
// MBProgressHUD* HUD = [[MBProgressHUD alloc] initWithView:self];
// HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"newfor"]];
// [self addSubview:HUD];
// HUD.mode = MBProgressHUDModeCustomView;
// HUD.labelText = @"发送消息成功";
// [HUD show:YES];
// [HUD hide:YES afterDelay:3];
UIWindow *window = [UIApplicationsharedApplication].keyWindow;
[MBProgressHUDhideAllHUDsForView:windowanimated:YES];
_hud = [MBProgressHUDshowHUDAddedTo:window animated:YES]
}
//-(void)myProgressTask{
// sleep(3);
//}
- MBProgressHUD的基本用法
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- MBProgressHUD的基本使用
- 让python同时兼容python2和python3的8个技巧分享
- python paramiko利用sftp上传目录到远程
- jvm调优总结---jvm参数配置
- JFinal+FreeMarker+Tomcat下ajax跨域请求
- Android实现下载图片,视频,APK功能等功能
- MBProgressHUD的基本用法
- JSON解析
- (转) 卷积的意义
- ORA-01775: 同义词的循环链
- 排列的字典序问题
- 列表的height根据内容自适应
- OLAP基础
- CentOS6.5安装scikit-learn
- 中兴营销类校招交流群 564742543