IOS 加载中提示框
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 加载中提示框的更多相关文章
- jquery mobile 请求数据方法执行时显示加载中提示框
在jquery mobile开发中,经常需要调用ajax方法,异步获取数据,如果异步获取数据方法由于网速等等的原因,会有一个反应时间,如果能在点击按钮后数据处理期间,给一个正在加载的提示,客户体验会更 ...
- 微信小程序之----加载中提示框loading
loading loading只有一个属性hidden .wxml <view> <loading hidden="{{hidden}}"> 加载中... ...
- [转]jquery的ajax交付时“加载中”提示的处理方法
本文转自:http://www.educity.cn/wenda/77121.html jquery的ajax提交时“加载中”提示的处理方法 方法1:使用ajaxStart方法定义一个全局的“加 ...
- jquery的ajax提交时“加载中”提示的处理方法
方法1:使用ajaxStart方法定义一个全局的“加载中...”提示 $(function(){ $("#loading").ajaxStart(function(){ ...
- iOS -iOS9中提示框(UIAlertController)的常见使用
iOS 8 之前提示框主要使用 UIAlertView和UIActionSheet:iOS 9 将UIAlertView和UIActionSheet合二为一为:UIAlertController . ...
- JQuery插件:遮罩+数据加载中。。。(特点:遮你想遮,罩你想罩)
在很多项目中都会涉及到数据加载.数据加载有时可能会是2-3秒,为了给一个友好的提示,一般都会给一个[数据加载中...]的提示.今天就做了一个这样的提示框. 先去jQuery官网看看怎么写jQuery插 ...
- js中提示框闪退问题
当页面存在刷新 或 在线引用iframe框架时(引用框架也会导致刷新) 会导致页面加载时的弹出框闪退 解决方法:设置弹出框在页面或者框架完全加载一段时间后再弹出 <script type=& ...
- jQuery Mobile 手动显示ajax加载器,提示加载中...
在使用jQuery Mobile开发时,有时候我们需要在请求ajax期间,显示加载提示框(例如:一个旋转图片+一个提示:加载中...).这个时候,我们可以手动显示jQuery Mobile的加载器,大 ...
- ASP.NET中页面加载时文本框(texbox控件)内有文字获得焦点时文字消失
代码如下: <asp:TextBox ID="TextBox1" runat="server" Height="26px" MaxLe ...
随机推荐
- 04747_Java语言程序设计(一)_第9章_输入和输出流
例9.1一个文件复制应用程序,将某个文件的内容全部复制到另一个文件. import java.io.*; public class Example9_1 { public static void ma ...
- jsp判断session中的值
方法有两种: 假设,此session的名字叫adminAccount 1.EL表达式 <script type="text/javascript"> if($.trim ...
- SPRING源码分析:IOC容器
在Spring中,最基本的IOC容器接口是BeanFactory - 这个接口为具体的IOC容器的实现作了最基本的功能规定 - 不管怎么着,作为IOC容器,这些接口你必须要满足应用程序的最基本要求: ...
- Codeforces 466 E. Information Graph
并查集.... E. Information Graph time limit per test 1 second memory limit per test 512 megabytes input ...
- Android开发 ADB server didn't ACK, failed to start daemon解决方案
有时候在打开ddms的时候,会看到adb会报如题的错误,解决方案是打开任务管理器,(ctrl+shift+esc),然后关掉adb.exe的进程,重启eclipse就ok了. 还有许多无良商家开发的垃 ...
- MATLAB快速注释方法
觉得有用,未免以后忘记,收藏了.原文来自:http://i.azpala.com/2008/09/18/matlab-multi-line-comment/ A. %{ 若干语句 %} B. 多行注释 ...
- css之浏览器初始化方案
HTML, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, blockquote,pre, form, fieldset, ...
- Know Thy Complexities!
http://bigocheatsheet.com/ Hi there! This webpage covers the space and time Big-O complexities of c ...
- 基础命名空间:序列化 System.Runtime.Serialization
对象通常都有状态(state),从一个对象中抽取这种状态,不论是将它存储于某地,还是通过网络传送,这种抽取动作称为“将一个对象序列化”,而反向处理过程,从一个被序列化的状态重建一个对象即为反序列化. ...
- OpenCV——像素数据类型总结<摘>
1.Unsigned 8bits(一般的图像文件格式使用的大小)IplImage数据结构参数:IPL_DEPTH_8UCvMat数据结构参数:CV_8UC1,CV_8UC2,CV_8UC3,CV_8U ...