IOS7中UIAlertView上添加UIActivityIndicatorView提示 简单方法
来源:互联网 发布:网络电影分账比例 编辑:程序博客网 时间:2024/06/03 22:37
.h
@interface WaitingView : UIView
@end
@interface TextAlertView : UIView
{
UILabel *textLabel;
}
-(void)ComeInAnimation:(UIView*)superView text:(NSString*)title;
-(void)GoOutAnimation;
@end
.m
@implementation WaitingView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
//self.backgroundColor=[UIColor grayColor];
//self.alpha=0.2;
UIView *v=[[UIViewalloc] initWithFrame:CGRectMake(320/2-30,568/2-100,60, 60)];
v.backgroundColor=[UIColordarkGrayColor];
v.layer.masksToBounds =YES;
v.layer.cornerRadius =6.0;
v.layer.borderWidth =1;
v.layer.borderColor = [[UIColorwhiteColor] CGColor];
[self addSubview:v];
UIActivityIndicatorView *actview = [[UIActivityIndicatorViewalloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
actview.center=CGPointMake(v.frame.size.width/2, v.frame.size.height/2);
[actview startAnimating];
[v addSubview:actview];
//把 UIActivityIndicatorView加到 UIView 中
}
return self;
}
@end
@implementation TextAlertView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor=[UIColordarkGrayColor];
self.layer.masksToBounds =YES;
self.layer.cornerRadius =0;
self.layer.borderWidth =1.5;
self.layer.borderColor = [[UIColorblackColor] CGColor];
textLabel=[[UILabelalloc] initWithFrame:CGRectMake(0,0, frame.size.width, frame.size.height)];
textLabel.textColor=[UIColorwhiteColor];
textLabel.textAlignment=NSTextAlignmentCenter;
textLabel.font=[UIFontsystemFontOfSize:12];
textLabel.backgroundColor=[UIColorclearColor];
[self addSubview:textLabel];
}
return self;
}
-(void)ComeInAnimation:(UIView*)superView text:(NSString*)title
{
textLabel.text=title;
[superView addSubview:self];
[UIView beginAnimations:@"add"context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeftforView:selfcache:YES];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDuration:0.3f];
[UIView commitAnimations];
}
-(void)GoOutAnimation
{
[selfremoveFromSuperview];
[UIView beginAnimations:@"remove"context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRightforView:selfcache:YES];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDuration:0.3f];
[UIView commitAnimations];
}
@end
初始化
加载
取消
- IOS7中UIAlertView上添加UIActivityIndicatorView提示 简单方法
- iOS UIAlertView中UIActivityindicatorView风火轮提示加载等待
- 简单实现UIActivityIndicatorView上添加文字
- 把UIActivityindicatorView 添加到 UIAlertView里面
- UIAlertView+UIActivityIndicatorView
- UIAlertView+UIActivityIndicatorView
- IOS7上dismissViewControllerAnimated与UIAlertView中delegate使用同一个对象
- 为UIAlertView上的按钮添加方法,需要重写协议中对话框按钮点击事件方法
- IOS UIAlertView 上添加View
- ios7中不支持自定义UIAlertView的样式
- iOS开发从入门到精通-- 警告对话框UIAlertView和等待提示器UIActivityIndicatorView
- UIAlertView视图中添加UITextField
- UIAlertView视图中添加UITextField
- 自定义的UIAlertView不能在iOS7上正常显示
- 自定义的UIAlertView不能在iOS7上正常显示
- 自定义的UIAlertView不能在iOS7上正常显示
- UIAlertView上添加输入框UITextField
- ios7 UIAlertView自定义
- 求整形数组的一个子数组,使得该子数组所有元素的和的绝对值最大。
- APUE之从eth0中获取ip地址
- 金山产品使用心得分享
- struts2 ognl 取action类中的值到jsp页面中
- c++ c# map
- IOS7中UIAlertView上添加UIActivityIndicatorView提示 简单方法
- 深度思考Java成员变量的初始化
- JAVA操作properties文件
- php socket讲解与实例
- 配置nfs服务器
- 机房收费系统—结账
- 线程里更新UI的两种方法:Thread+Handler和Runnable
- opencv中各模块介绍
- LoadRunner组成和工作原理