码迷,mamicode.com
首页 > 其他好文 > 详细

UI: 使用UIProgressView显示进度条

时间:2014-10-16 12:45:32      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   使用   ar   strong   文件   sp   

1.问题

你想在屏幕上显示一个进度条来??述某任务的进度。例如,从 URL 下载一个文件的进 度条。 

2.

进度视图是 UIProgressView 的一个实例对象,并被此类设计好的初始化器初始化,使用 initWithProgressViewStyle:这个方法。这个方法的参数可以指定进度条的风格。这个参数是 UIPogressViewStyle 类型,并可以是以下所示的值:
UIProgressViewStyleDefault    这是默认的风格。

UIProgressViewStyleBar       跟 UIProgressViewStyleDefault 相似,不过这是用于添加到 toolbar 中的进度视图。 

- (void)viewDidLoad{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; 
self.progressView.center = self.view.center;
self.progressView.progress = 0.5f;
[self.view addSubview:self.progressView];
}

 

UI: 使用UIProgressView显示进度条

标签:style   blog   color   io   使用   ar   strong   文件   sp   

原文地址:http://www.cnblogs.com/safiri/p/4028247.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!