当前位置:首页 > 操作系统 > Ios

ios之UIProgressView

UIProgressView和UIActivityIndicator有些类似

 
但是不同之处在于,
UIProgressView能够更加精确的反应进度
UIActivityIndicator则只能表示事物在进行中
 
有一个例子是在Mail程序中当在下载信息的时候,有一个UIProgressView显示在底部
 
初始化方法
- (id)initWithProgressViewStyle:( UIProgressViewStyle )<EM style=‘line-height: normal; font-family: "Lucida Grande", Geneva, Helvetica, Arial, sans-serif; font-style: italic; background-color: rgb(255, 255, 255);‘>style
 
UIProgressViewStyle 有两个枚举变量
1. UIProgressViewStyleDefault         
 
bubuko.com,布布扣 
2. UIProgressViewStyleBar 一般用于toolbar
 
bubuko.com,布布扣 
配置UIProgressView
progressViewStyle 属性
progressTintColor 属性 填充部分的颜色(譬如进度到30%,那么30%部分的颜色就是这个属性)iOS 5新增
progressImage 属性,填充部分的图片,设置图片之后progressTintColor无效,iOS 5新增
trackTintColor 属性,未填充部分的颜色 iOS 5新增
trackImage 属性,未填充部分的图片,设置图片后trackTintColor无效  iOS 5新增
 
管理UIProgressView
progress 属性 当前进度值
- (void)setProgress:(float)<EM style=‘line-height: normal; font-family: "Lucida Grande", Geneva, Helvetica, Arial, sans-serif; font-style: italic; background-color: rgb(255, 255, 255);‘>progress animated:(BOOL)<EM style=‘line-height: normal; font-family: "Lucida Grande", Geneva, Helvetica, Arial, sans-serif; font-style: italic; background-color: rgb(255, 255, 255);‘>animated
<EM style=‘line-height: normal; font-family: "Lucida Grande", Geneva, Helvetica, Arial, sans-serif; font-style: italic; background-color: rgb(255, 255, 255);‘>设置当前进度值 iOS 5新增

原文:http://www.cnblogs.com/yulang314/p/3550411.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!