IOS 加载中提示框
2014-03-06 16:18
295 查看
LoadingView.h #import <Foundation/Foundation.h> @class MBProgressHUD; @interface LoadingView : NSObject @property (nonatomic, retain) MBProgressHUD *HUD; + (LoadingView *)sharedInstance; /** * 加载中提示框 * * @param title 标题 * @param superView 父View */ - (void)showLoadingViewWithTitle:(NSString *)title superView:(UIView *)superView; /** * 加载中提示框 * * @param title 标题 * @param delay 关闭时间 * @param superView 父View */ - (void)showLoadingViewWithTitle:(NSString *)title afterDelay:(NSTimeInterval)delay superView:(UIView *)superView; /** * 关闭提示框 */ - (void)closeLoadingView; @end LoadingView.m #import "LoadingView.h" #import "MBProgressHUD.h" @implementation LoadingView @synthesize HUD; static LoadingView *_shardLoadingView = nil; + (LoadingView *)sharedInstance { if (_shardLoadingView == nil) { _shardLoadingView = [[LoadingView alloc]init]; } return _shardLoadingView; } - (id)init { self = [super init]; if (self) { HUD = [[MBProgressHUD alloc] init]; } return self; } - (void)showLoadingViewWithTitle:(NSString *)title superView:(UIView *)superView { HUD.labelText = title; [superView addSubview:HUD]; [superView bringSubviewToFront:HUD]; [HUD show:YES]; } - (void)showLoadingViewWithTitle:(NSString *)title afterDelay:(NSTimeInterval)delay superView:(UIView *)superView { HUD.labelText = title; [superView addSubview:HUD]; [superView bringSubviewToFront:HUD]; [HUD show:YES]; [HUD hide:YES afterDelay:delay]; } - (void)closeLoadingView { [HUD hide:YES]; } @end // 使用 [[LoadingView sharedInstance]showLoadingViewWithTitle:@"加载中...." superView:self.view];
相关文章推荐
- ios新手开发——toast提示和旋转图片加载框
- 自适应文案提示框、无数据图片加载<IOS小组件>
- iOS MBProgressHUD 之带底板的加载提示
- iOS 封装加载、提示窗progressHUD —— HERO博客
- ios新手开发——toast提示和旋转图片加载框
- ios webview加载html提示101错误问题解决
- iOS UIAlertView中UIActivityindicatorView风火轮提示加载等待
- 关于如何在iOS开发中使用风火轮UIActivityIndicatorView提示加载等待
- 郑州iOS點 - 关于点击友好提示重新加载
- iOS 下拉刷新的时候加一个提示加载了多少条
- iOS主流进度加载提示工具
- iOS 异步图片加载优化与常用开源库分析
- 【iOS和HTML 5交互】iOS中加载html5调用html方法和修改html5内容
- ios ableviewcell的动态加载数据,模仿喜马拉雅动态数据加载
- iOS 图片加载框架SDWebImage详解
- iOS 原生如何加载html标签
- JQUERY加载中提示方法
- ios开发 集成zfdownload ASIWebPageRequest.h提示libxml.h找不到
- 25个增强iOS应用程序性能的提示和技巧--中级篇
- ios webView JS代码加载