【代码笔记】iOS-自定义loading(IanAlert)
来源:互联网 发布:漫步者s1000 知乎 编辑:程序博客网 时间:2024/06/06 09:02
一,效果图。
二,工程图。
三,代码。
ViewController.h
#import <UIKit/UIKit.h>@interface ViewController : UIViewController{ //loading UIView *backViewLoad;}@end
ViewController.m
#import "ViewController.h"//loading#import "IanAlert.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //loading [self addLoadingView];}//点击任何处显示loading-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ //loading backViewLoad.hidden=NO; [IanAlert showloading]; [self performSelector:@selector(loadStop) withObject:nil afterDelay:2.0];}//停止loading-(void)loadStop{ backViewLoad.hidden=YES; [IanAlert hideLoading];}#pragma -mark --loading-------(void)addLoadingView{ backViewLoad=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; backViewLoad.backgroundColor=[UIColor blackColor]; backViewLoad.alpha=0.8; backViewLoad.hidden=YES; [self.view addSubview:backViewLoad];}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}@end
阅读全文
0 0
- 【代码笔记】iOS-自定义loading(IanAlert)
- 【代码笔记】iOS-自定义Loading
- 【代码笔记】iOS-自定义开关
- 【代码笔记】iOS-自定义alertView
- 【代码笔记】iOS-自定义switch
- 【代码笔记】iOS-自定义弹出框
- 【代码笔记】iOS-自定义导航条颜色
- 【代码笔记】iOS-自定义选择框
- IOS自定义请求uiwebview的loading框
- 【代码笔记】iOS-自定义选择框(高底强弱)
- iOS自定义代码块
- 自定义loading 以及动画loading
- IOS自定义状态栏代码解析
- iOS 代码自定义cell示例
- iOS自定义代码补全
- ios中代码自定义uitableviewcell
- iOS 代码实现自定义TableView 自定义TableViewCell
- Flex自定义Loading界面
- SpringBoot学习记录二、基本使用
- 布局二级购物车
- 加接口的AsyncTask工具类
- 从0到1 | 0基础/转行如何用3个月搞定机器学习
- Linux下Tomcat开机自动启动 原创 2014年07月18日 12:32:49 标签:Linux /tomcat /shell /启动 22095 Linux下tomcat开机自动启动有两种方法
- 【代码笔记】iOS-自定义loading(IanAlert)
- [转] Ubuntu 16.04 U盘安装图文教程
- 使用Python语言完成SVM实现分类
- Vue.js的几个简单属性方法
- JavaScript之类型判断
- 经典博弈
- Ubuntu PeaZip [最好的压缩解压缩软件]
- NPM小结
- xml格式原样输出到html或是jsp页面