1。 网上下载 MBProgessHUD 类,导入到工程。
https://github.com/jdg/MBProgressHUD 2。#import "MBProgressHUD.h"
类实现 MBProgressHUDDelegate 代理。
3。 在类里面定义:
隐藏:
view plain
5。实现协议:
view plain
https://github.com/jdg/MBProgressHUD 2。#import "MBProgressHUD.h"
类实现 MBProgressHUDDelegate 代理。
3。 在类里面定义:
MBProgressHUD* progress_;
4。 显示;
- progress_ = [[MBProgressHUD alloc] initWithView:self.tableView]; [self.view addSubview:progress_]; [self.view bringSubviewToFront:progress_]; progress_.delegate = self; progress_.labelText = @"加载中..."; [progress_ show:YES];
隐藏:
view plain
- if (progress_) { [progress_ removeFromSuperview]; [progress_ release]; progress_ = nil; }
5。实现协议:
view plain
- - (void)hudWasHidden:(MBProgressHUD *)hud { NSLog(@"Hud: %@", hud); // Remove HUD from screen when the HUD was hidded [progress_ removeFromSuperview]; [progress_ release]; progress_ = nil; }
图像及动画处理三:WaitingBar
一个很简单的等待页面的等待条的制作,方法如下:
- (id)initWithFrame:(CGRect)aFrame color:(UIColor*)aColor timeInterval:(float)aInterval;
discussion:
arguments-
aFrame:视图框架,包括所有小球,其高为小球直径的2倍,宽与高的比值的2倍为小球的数量
aColor:小球颜色
aInterval:相邻小球跳动的时间间隔
return value:视图,包括所有小球
以上为公共参数,当然也可以根据需要,自行在方法体中进行更细致和专门的修改.效果如下图:

一个很简单的等待页面的等待条的制作,方法如下:
- (id)initWithFrame:(CGRect)aFrame color:(UIColor*)aColor timeInterval:(float)aInterval;
discussion:
arguments-
aFrame:视图框架,包括所有小球,其高为小球直径的2倍,宽与高的比值的2倍为小球的数量
aColor:小球颜色
aInterval:相邻小球跳动的时间间隔
return value:视图,包括所有小球
以上为公共参数,当然也可以根据需要,自行在方法体中进行更细致和专门的修改.效果如下图:
