5.MBProgressHUD中间转圈来提高用户的体验
2016-08-29 本文已影响264人
IIronMan
简述:这个框架说实话它就是一个弹框的展示来提高用户对数据的等待的耐心,以及提高用户对产品的体验!和网络没关系,说白了就是一个提示弹框
下面讲解一下它的用法
<1>目前我习惯手动导入这一个框架,更新之后的我不习惯
MBProgressHUD框架密码: 78qw

导入 #import "HUD.h"
我们需要在框架里面更改一些东西
在HUD.m里面第80行(更改我们需要的转圈颜色)
gradienLayer.colors = [self gradientColorArrayWithColor:[UIColor colorWithRed:0/255.0 green:205/255.0 blue:18/255.0 alpha:1.0]];
第52行更改转圈的图片(添加进来一张需要的图片,做成圆的好看,根据需要来更换图片)
UIImageView *imgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"jiazai"]];
//更改图片的名字
(1)只显示文字
+ (void)showLoadingHUDWithText:(NSString *)text;
调用 [HUD showLoadingHUDWithText:@"这里写要展示的文字"]
[HUD hideHUD];隐藏展示

(2) 显示文字和图片
+ (void)showLoadingHUDWithText:(NSString *)text inView:(UIView *)containerView;
调用 [HUD showLoadingHUDWithText:@"加载数据" inView:self.view]
[HUD hideHUD];隐藏展示
(3)加载成功和失败调用(1秒后会自动隐藏)
[MBProgressHUD showSuccess:@"加载成功"];
[MBProgressHUD showError:@"加载失败"];


简单的源码MBProgressHUD 密码: kmxy