【IOS控件详解】之MBProgressHUD使用
来源:互联网 发布:魔幻拼图软件下载 编辑:程序博客网 时间:2024/05/20 19:16
MBProgressHUD是替代UIProgressHUD的一个小工具,使用方法也非常简单
下载地址是: http://github.com/matej/MBProgressHUD
#import <UIKit/UIKit.h>
#import "MBProgressHUD.h"
@
interface
HudDemoViewController : UIViewController <MBProgressHUDDelegate> {
MBProgressHUD *HUD;
}
- (IBAction) showWithLabel:(id)sender;
- (
void
) myTask;
@end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@implementation
HudDemoViewController
- (
IBAction
) showWithLabel:(
id
)sender {
// Should be initialized with the windows frame so the HUD disables all user input by covering the entire screen
HUD = [[MBProgressHUD alloc] initWithWindow:[UIApplication sharedApplication].keyWindow];
// Add HUD to screen
[
self
.view.window addSubview:HUD];
// Regisete for HUD callbacks so we can remove it from the window at the right time
HUD.delegate =
self
;
HUD.labelText = @
"Loading"
;
// Show the HUD while the provided method executes in a new thread
[HUD showWhileExecuting:
@selector
(myTask) onTarget:
self
withObject:
nil
animated:
YES
];
}
- (
void
) myTask {
// Do something usefull in here instead of sleeping ...
sleep(3);
}
- (
void
)hudWasHidden {
// Remove HUD from screen when the HUD was hidded
[HUD removeFromSuperview];
[HUD release];
}
@end
原文:http://www.cnblogs.com/GnagWang/archive/2011/09/29/2195710.html
- 【IOS控件详解】之MBProgressHUD使用
- IOS 第三方库之-MBProgressHUD的使用详解
- IOS 第三方库之-MBProgressHUD的使用详解
- iOS开发之MBProgressHUD的使用
- iOS开发之MBProgressHUD
- iOS MBProgressHUD的使用
- MBProgressHUD的使用-ios
- iOS MBProgressHUD使用
- MBProgressHUD 的使用详解
- MBProgressHUD 使用详解
- MBProgressHUD.h使用详解
- MBProgressHUD 使用详解
- iOS开源:进度条控件MBProgressHUD
- iOS 第三方类库之MBProgressHUD
- iOS 第三方类库之MBProgressHUD
- iOS之MBProgressHUD用法总结
- ios 指示器MBProgressHUD 的使用
- ios MBProgressHUD的基本使用
- URL最大长度问题 IIS 7问题
- android 签名报错
- CSS | DIV 水平和竖直方向居中
- IP视频通信中的丢包—“恢复技术”
- SQL Server 2008 游标使用实例
- 【IOS控件详解】之MBProgressHUD使用
- iphone(苹果)手机登陆Exchange 2013邮箱帐号的配置
- Java进程Id
- WINDOWS消息队列管理的工具--QueueExplorer
- 自定义搜索帮助
- swap交换函数
- OpenGL ES2学习笔记(9)-- 转换矩阵
- 2013年10月12日、|面试心得|
- MyEclipse使用技巧:快速找到某个文件在包中的位置