UIProgressView
2016-07-03 20:54
471 查看
#import "ViewController.h" @interface ViewController () { UIProgressView *progressView; BOOL isFill; } @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. isFill = NO; progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault]; [self.view addSubview:progressView]; progressView.frame = CGRectMake(10,100,300,100); //progressView.center=CGPointMake(160,100); progressView.progress = 0.1; progressView.tintColor = [UIColor redColor]; progressView.trackTintColor = [UIColor greenColor]; //progressView.progressImage = [UIImage imageNamed:@"loading_0.png"]; } - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { //[progressView setProgress:arc4random()%10/10.0 animated:YES]; if(progressView.progress==1.0){ isFill = YES; }else if(progressView.progress==0.0){ isFill = NO; } if(!isFill) { float f = progressView.progress + 0.5; [progressView setProgress:f animated:YES]; }else{ float f = progressView.progress - 0.5; [progressView setProgress:f animated:YES]; } } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end
相关文章推荐
- APUE(5)---标准I/O库 (2)
- 复制UIView
- Android的UI布局
- UIPageController和UIScrollView结合使用
- Android UI控件学习笔记(二)
- 自定义 UISwitch
- 【Codeforces】-#222A-KShooshuns and Sequence(思维)
- FragmentTabHost 的使用+一个上架项目源码+一个UI项目源码
- kvm 中 Guest Is already in use 处理办法
- gradle 构建 Smack 报错:Can't find android.jar for 8 API. + steps for building android platform
- EasyUI学习总结(三)——EasyUI组件使用
- requirejs里的require方法
- hibernate uniqueResult方法
- 【CodeForces】222A - Shooshuns and Sequence(思维)
- LeetCode 334 Increasing Triplet Subsequence
- vue-cli需要的包
- EasyUI学习总结(二)——EasyUI布局
- EasyUI学习总结(一)——EasyUI入门
- cQueue类型定义
- iOS GPUImage之GPUImageMovie视频滤镜(2)