【代码笔记】iOS-正在加载
2016-07-21 09:04
309 查看
一,效果图。
二,代码。
二,代码。
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self showFooter:YES]; } -(void)showFooter:(BOOL)showFooter { NSLog(@"上拉刷新:加载更多view"); if(!loadMoreView) { loadMoreView=[[UIView alloc]init]; //加载控件 UIActivityIndicatorView *activeView=[[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; [activeView setFrame:CGRectMake(110, 10, 30, 30)]; [activeView setBackgroundColor:[UIColor clearColor]]; [loadMoreView addSubview:activeView]; [activeView startAnimating]; //文本 UILabel *loadLabel=[[UILabel alloc]initWithFrame:CGRectMake(140, 10, 150, 30)]; [loadLabel setTextAlignment:NSTextAlignmentLeft]; [loadLabel setText:@"正在加载"]; [loadLabel setTextColor:[UIColor colorWithRed:150/255.00 green:150/255.00 blue:150/255.00 alpha:1.0]]; [loadLabel setBackgroundColor:[UIColor clearColor]]; [loadMoreView addSubview:loadLabel]; } [loadMoreView setFrame:CGRectMake(0, 60, 320, 100)]; [loadMoreView setBackgroundColor:[UIColor clearColor]]; if(!loadMoreView.superview) { [self.view addSubview:loadMoreView]; } if(showFooter) { [loadMoreView setAlpha:1]; } else { [loadMoreView setAlpha:0]; } }
相关文章推荐
- 【代码笔记】iOS-正在加载
- iOS开发:打包ipa
- 教你快速拿到iOS应用中所有图片资源
- iOS卡片容器iCards
- 清除xcode 缓存文件
- iOS开发Extra系列:NSString***
- CAAnimation 类
- iOS8.0技术点总结,省的大家找了
- iOS 将图片保存到本地相册
- iOS9 新特性 3DTouch
- 自定义重排的CollectionView
- iOS开发中实用代码片段
- iOS Exception Code 之 Magic Number
- iOS 添加view的分类(更加方便的设置view的位置)
- iOS平台Cocoa Touch层
- iOS消息推送之远程推送
- IOS学习笔记-CocoaPods类库管理工具安装
- presentViewController 、pushViewController和presentModalViewController
- iOS消息推送之本地推送
- ios developer tiny share-20160720