标签:ui控件 uiactivityindic 以及自定义颜色
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
// UIActivityIndicatorView 等待旋转
[super viewDidLoad];
UIButton * btn = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 140, 45)];
btn.backgroundColor = [UIColor greenColor];
[btn addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
self.view.backgroundColor = [UIColor blueColor];
UIActivityIndicatorView * act = [[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
act.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
act.center = self.view.center;
act.tag = 110;
[act startAnimating];
[self.view addSubview:act];
// RGB格式转换 123 23 233 (255,255,255) alpha是透明度
act.backgroundColor = [UIColor colorWithRed:1/123 green:1/23 blue:1/233 alpha:0.5];//自定义颜色
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)click{
UIActivityIndicatorView * act = (UIActivityIndicatorView *)[self.view viewWithTag:110];
if ([act isAnimating]) {
[act stopAnimating];
}else{
[act startAnimating];
}
}
@end
UI控件 UIActivityIndicatorView 等待时出现的动态旋转图,以及自定义颜色UI控件 UIActivityIndicatorView 等待时出现的动态旋转图,以及自定义颜色UI控件 UIActivityIndicatorView 等待时出现的动态旋转图,以及自定义颜色UI控件
UIActivityIndicatorView 等待时出现的动态旋转图,以及自定义颜色UI控件 UIActivityIndicatorView 等待时出现的动态旋转图,以及自定义颜色UI控件 UIActivityIndicatorView 等待时出现的动态旋转图,以及自定义颜色UI控件 UIActivityIndicatorView 等待时出现的动态旋转图,以及自定义颜色UI控件 UIActivityIndicatorView 等待时出现的动态旋转图,以及自定义颜色UI控件 UIActivityIndicatorView
等待时出现的动态旋转图,以及自定义颜色
UI控件 UIActivityIndicatorView 等待时出现的动态旋转图,以及自定义颜色
标签:ui控件 uiactivityindic 以及自定义颜色
原文地址:http://blog.csdn.net/zx6268476/article/details/45148469