iOS菊花加载圈
2017-01-18 16:47
176 查看
自定制一个继承于UIView的类然后重写initWithFrame方法;如下
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// 菊花背景的大小
self.frame = CGRectMake(kWidth/2-50, KHeight/2-50, 100, 100);
// 菊花的背景色
self.backgroundColor = MYCOLOR;
self.layer.cornerRadius = 10;
// 菊花的颜色和格式(白色、白色大、灰色)
self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
// 在菊花下面添加文字
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 60, 80, 40)];
label.text = @"loading...";
label.font = [UIFont systemFontOfSize:14];
label.textAlignment = NSTextAlignmentCenter;
label.textColor = [UIColor whiteColor];
[self addSubview:label];
}
return self;
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// 菊花背景的大小
self.frame = CGRectMake(kWidth/2-50, KHeight/2-50, 100, 100);
// 菊花的背景色
self.backgroundColor = MYCOLOR;
self.layer.cornerRadius = 10;
// 菊花的颜色和格式(白色、白色大、灰色)
self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
// 在菊花下面添加文字
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 60, 80, 40)];
label.text = @"loading...";
label.font = [UIFont systemFontOfSize:14];
label.textAlignment = NSTextAlignmentCenter;
label.textColor = [UIColor whiteColor];
[self addSubview:label];
}
return self;
}
相关文章推荐
- iOS 加载H5页面的时候添加一个菊花
- Android仿ios加载时菊花图
- 菊花加载第三方--MBprogressHUD 分类: ios技术 2015-02-05 19:21 120人阅读 评论(0) 收藏
- iOS开发中在加载页面添加菊花动画(非第三方)
- 【IOS】多语言资源文件加载的一种解决方案
- IOS-图像处理-查找和加载图像
- iOS开发之---图片资源加载问题
- [iOS] ViewController的生命周期及其加载View的步骤
- ios开发笔记之 MPMoviePlayerController网络视频加载
- Android加载数据过程中的菊花显示
- IOS基本界面元素window(窗口)\视图(view)介绍及生命周期和加载过程等
- IOS开发UI篇之──自定义加载等待框(MBProgressHUD)
- IOS UITableView某一行重新加载数据
- 解决Ios加载大图时出JPEG Corrupt JPEG data: premature end of data segment错误,导致加载时卡的问题。
- IOS开发之程序首次启动时加载关于程序应用的简介
- iOS开发之异步加载图片
- IOS开发网络加载图片缓存策略之──ASIDownloadCache缓存策略
- Android加载数据过程中的菊花显示
- IOS开发之xcode 4设置应用程序图标及加载图片
- ios UITableView分页加载