旋转进度条 WaitView
来源:互联网 发布:sql update批量更新 编辑:程序博客网 时间:2024/05/17 08:55
WaitView.h
#import <Foundation/Foundation.h>
@interface WaitView : NSObject
+ (UIView*)CreateWaitView:(NSString *)waitInfo tag:(NSInteger)tag;
@end
WaitView.m
#import "WaitView.h"
@implementation WaitView
+ (UIView*)CreateWaitView:(NSString *)waitInfo tag:(NSInteger)tag
{
CGRect waitViewRect = CGRectMake(80, 180-64, 160, 120);//368
UIView *waitView = [[UIView alloc] initWithFrame:waitViewRect];
waitView.backgroundColor = [UIColor clearColor];
CGRect bgImageRect = CGRectZero;
bgImageRect.size = waitViewRect.size;
UIImageView *bgImageView = [[UIImageView alloc] initWithFrame:bgImageRect];
bgImageView.image = [UIImage imageNamed:@"waitBg.png"];
[bgImageView setAlpha:0.8];
[waitView addSubview:bgImageView];
CGRect activityViewRect = CGRectMake(55,25, 50, 50);
UIActivityIndicatorView *activityView= [[UIActivityIndicatorView alloc] initWithFrame:activityViewRect];
activityView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
[waitView addSubview:activityView];
CGRect labelRect = activityViewRect;
labelRect.origin.y = activityViewRect.origin.y + activityViewRect.size.height;
labelRect.origin.x = 0;
labelRect.size.height = 30;
labelRect.size.width = waitViewRect.size.width;
UILabel *label = [[UILabel alloc] initWithFrame:labelRect];
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor whiteColor];
label.text = waitInfo;
label.font = [UIFont systemFontOfSize:14.0];
label.textAlignment = NSTextAlignmentCenter;
[waitView addSubview:label];
[activityView startAnimating];
[waitView setTag:tag];
return waitView;
}
@end
下面的是其中背景图片的素材。
使用的时候在你想调用的地方:
UIView*waitView=[WaitViewCreateWaitView:@"正在努力加载....." tag:100];
[self.view addSubview:waitView];
不要忘记导入 :
#import "WaitView.h"
//****************************************************和上面无关。
- (void)showWaitView:(NSString*)info;
- (void)dismissWaitView;
- (void)showWaitView:(NSString*)info
{
UIView *waitView = [WaitViewCreateWaitView:info tag:(EFAMILYNUMTAG*2)];
[self.view addSubview:waitView];
self.view.userInteractionEnabled =NO;
}
- (void)dismissWaitView
{
[[self.viewviewWithTag:(EFAMILYNUMTAG*2)]removeFromSuperview];
self.view.userInteractionEnabled =YES;
}
- 旋转进度条 WaitView
- 旋转进度条
- psplash进度条旋转成功
- psplash进度条旋转成功
- 自定义旋转进度条
- android 绘制旋转进度条
- 进度条图片匀速旋转
- HTML5+css3圆形指针旋转进度条、css3动态进度条
- 1. UIActivityIndicatorView(旋转的进度条)
- MFC控件编程:旋转按钮、进度条和滑块控件
- android 最简单的方式实现旋转进度条
- Android-两个小球不停的绕中心旋转的进度条
- Android-两个小球不停的绕中心旋转的进度条
- android 圆形进度条(旋转的等待动画)
- android 圆形进度条(旋转的等待动画)
- Css的一些效果代码(旋转,进度条,透明,固定)
- Android 自定义圆形旋转进度条,仿微博头像加载效果
- 进度条
- find path/route in a maze 2 d matrix
- swift总结1
- 流媒体分发方式比较
- IOS8下的数据搜索
- 做人要有乐趣2
- 旋转进度条 WaitView
- Python--迭代器
- 1051. Pop Sequence (25)
- DataGridView DataSource 如何实现排序
- Lua和C++交互详细总结
- 【转载】CSS clear 清除浮动
- 遇见,就是最好的
- 使用eclipse+tomcat+maven插件创建web项目
- NYOJ 116 士兵杀敌(二)(线段树区间求和+单点更新)