IOS MBProgressHUD的使用
一,简介
二,使用
1,下载
2,添加到自己的工程

3,代码中使用
#import <UIKit/UIKit.h>
#import "MBProgressHUD.h"
@interface SplashViewController : UIViewController<MBProgressHUDDelegate>
{
MBProgressHUD *HUD;
}
@property (strong, nonatomic) IBOutlet UILabel *beiJingTime;//UILabel:显示从网络获取到的北京时间,在此label显示出来
- (IBAction)btn_Press:(UIButton *)sender;//点击按钮从网络获取北京时间。
@end
注意添加MBProgressHUDDelegate代理方法。
- (IBAction)btn_Press:(UIButton *)sender {//点击获取网络时间
HUD = [[MBProgressHUD alloc] initWithView:self.view];//注意,在SplashViewController.view中初始化
[self.view addSubview:HUD];
HUD.delegate = self;
HUD.labelText = @"正在加载";
HUD.detailsLabelText = @"加载中,请稍候。。。。";
HUD.square = YES;
[HUD showWhileExecuting:@selector(getTimeFromWeb) onTarget:self withObject:nil animated:YES];//执行获取网络时间
}
-(void)getTimeFromWeb
{
beiJingTime.text = [AppService BeiJingTime];
}
#pragma mark -
#pragma mark MBProgressHUDDelegate methods
- (void)hudWasHidden:(MBProgressHUD *)hud {//释放HUD
// Remove HUD from screen when the HUD was hidded
[HUD removeFromSuperview];
HUD = nil;
}
三,效果
IOS MBProgressHUD的使用的更多相关文章
- ios MBProgressHUD 使用,及二次封装
MBProgressHUD是一个显示HUD窗口的第三方类库,用于在执行一些后台任务时,在程序中显示一个表示进度的loading视图和两个可选的文本提示的HUD窗口.MBProgressHUD 二次封装 ...
- iOS MBProgressHUD 之带底板的加载提示
文章来自:http://blog.csdn.net/ryantang03/article/details/7877120 MBProgressHUD是一个开源项目,实现了很多种样式的提示框,使用上简单 ...
- wesome-android
awesome-android Introduction android libs from github System requirements Android Notice If the lib ...
- 【转】提示框第三方库之MBProgressHUD iOS toast效果 动态提示框效果
原文网址:http://www.zhimengzhe.com/IOSkaifa/37910.html MBProgressHUD是一个开源项目,实现了很多种样式的提示框,使用上简单.方便,并且可以对显 ...
- iOS提示框,为什么你应该使用 MBProgressHUD?
这是一篇带有一定笔者主观感情色彩的比较文章.文章着重对比github上最流行的两个iOS进度提示控件 MBProgressHUD 与 SVProgressHUD的各自优劣,来帮助初学者找到一个适合的i ...
- iOS 第三方类库之MBProgressHUD
github链接地址 MBProgressHUD是一个开源的第三方类库实现了很多种样式的提示框,类似Activity indicator,使用上简单.方便,并且可以对显示的内容进行自定义,功能很强大, ...
- iOS基于MBProgressHUD的二次封装,一行搞定,使用超简单
MBProgressHUD的使用,临时总结了几款最常用的使用场景: 1.提示消息 用法: [YJProgressHUD showMessage:@"显示文字,1s隐藏" inVie ...
- 【转】IOS学习笔记29—提示框第三方库之MBProgressHUD
原文网址:http://blog.csdn.net/ryantang03/article/details/7877120 MBProgressHUD是一个开源项目,实现了很多种样式的提示框,使用上简单 ...
- IOS中(类似于进度条哪种效果)MBProgressHUD的使用
1.显示HUD MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; hud.labelText = ...
随机推荐
- [Leetcode][JAVA] Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence ...
- [转]Liunx上安装svn客户端
[转]Liunx上安装svn客户端 虽然说很简单的用yum install subversion就可以将svn安装到系统中,但是yum库中的版本实在是有点低——1.4.2.因此我选择以源码方式安装.安 ...
- iOS开发零基础--Swift教程 类型转换
常见的类型转化符号 is : 用于判断一个实例是否是某一种类型 as : 将实例转成某一种类型 例子 // 1.定义数组 let array : [AnyObject] = [12, "wh ...
- Kernel Functions for Machine Learning Applications
In recent years, Kernel methods have received major attention, particularly due to the increased pop ...
- sql常见的面试题
1.用一条SQL语句 查询出每门课都大于80分的学生姓名 name kecheng fenshu 张三 语文 81张三 数学 75李四 语文 ...
- 新版SDWebImage的使用
第一步,下载SDWebImage,导入工程.github托管地址https://github.com/rs/SDWebImage 第二步,在需要的地方导入头文件 1 #import "UII ...
- Javascript 中的this 指向的对象,你搞清楚了吗?
Javascript 中的this 总让人感到困惑,你能分清以下三种test1(),test2(),test3() 情况下的输出吗? 注:以下Javascript运行环境中为浏览器 //1 this在 ...
- 测试了几款 C# 脚本引擎 , Jint , Jurassic , Nlua, ClearScript
测试类 public class Script_Common { public string read(string filename) { return System.IO.File.ReadAll ...
- 分享一个异步任务在遇到IO异常时支持递归回调的辅助方法
public void TryAsyncActionRecursively<TAsyncResult>( string asyncActionName, Func<Task<T ...
- 返本求源——DOM元素的特性与属性
抛砖引玉 很多前端类库(比如dojo与JQuery)在涉及dom操作时都会见到两个模块:attr.prop.某天代码复查时,见到一段为某节点设置文本的代码: attr.set(node, 'inner ...