IOS UIProgressView控件用法(进度条)
2016-06-28 14:38
537 查看
初始化一个进度条:
- (instancetype)initWithProgressViewStyle:(UIProgressViewStyle)style;
注意:1.用这个方式初始化的进度条系统会默认给一个长度。
2.进度条的长度可以通过frame来设置,但是只有前三个参数有效。
3.风格枚举如下:
typedef NS_ENUM(NSInteger, UIProgressViewStyle) {
UIProgressViewStyleDefault, // 普通样式
UIProgressViewStyleBar, // 用于工具条的样式
};
设置进度条风格样式
@property(nonatomic) UIProgressViewStyle progressViewStyle;
设置进度条进度(0.0-1.0之间,默认为0.0)
@property(nonatomic) float progress;
设置已走过进度的进度条颜色
@property(nonatomic, retain) UIColor* progressTintColor;
设置未走过进度的进度条颜色
@property(nonatomic, retain) UIColor* trackTintColor;
设置进度条已走过进度的背景图案和为走过进度的背景图案(IOS7后好像没有效果了)
@property(nonatomic, retain) UIImage* progressImage;
@property(nonatomic, retain) UIImage* trackImage;
设置进度条进度和是否动画显示(动画显示会平滑过渡)
- (void)setProgress:(float)progress animated:(BOOL)animated;
- (instancetype)initWithProgressViewStyle:(UIProgressViewStyle)style;
注意:1.用这个方式初始化的进度条系统会默认给一个长度。
2.进度条的长度可以通过frame来设置,但是只有前三个参数有效。
3.风格枚举如下:
typedef NS_ENUM(NSInteger, UIProgressViewStyle) {
UIProgressViewStyleDefault, // 普通样式
UIProgressViewStyleBar, // 用于工具条的样式
};
设置进度条风格样式
@property(nonatomic) UIProgressViewStyle progressViewStyle;
设置进度条进度(0.0-1.0之间,默认为0.0)
@property(nonatomic) float progress;
设置已走过进度的进度条颜色
@property(nonatomic, retain) UIColor* progressTintColor;
设置未走过进度的进度条颜色
@property(nonatomic, retain) UIColor* trackTintColor;
设置进度条已走过进度的背景图案和为走过进度的背景图案(IOS7后好像没有效果了)
@property(nonatomic, retain) UIImage* progressImage;
@property(nonatomic, retain) UIImage* trackImage;
设置进度条进度和是否动画显示(动画显示会平滑过渡)
- (void)setProgress:(float)progress animated:(BOOL)animated;
相关文章推荐
- The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported.
- vuejsLearn---通过手脚架快速搭建一个vuejs项目
- arm交叉编译器gnueabi、none-eabi、arm-eabi、gnueabihf、gnueabi区别
- Android漂亮的UI库集合
- AndroidStudio部署项目时出现错误:Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled
- vuejsLearn--- -- 怎么查看、修改、追加数据---->data对象
- UITableview顶部视图缩放效果
- UITextField的leftView属性
- iOS-改变UITextField的占位文字颜色(三种)
- [LC357]Count Numbers with Unique Digits
- liger UI tree DATA添加值
- Integer 的valueof() and praseInt()区别
- 点击UITableViewCell 来回切换内容
- Android学习笔记十之Android基础UI一
- mybatis Result Maps collection already contains value for com.ebways.dictionary.dao.impl.PtInfoDaoImpl.beanMap
- [LC347] Top K Frequent Elements
- .Net 下 百度 富文本框 Ueditor 的 使用
- 常用的图片处理框架UIL、Picasso、Glide、Fresco、Volley ImageLoader比较分析
- MySQL添加新用户 出现mysql]ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value
- emulator: ERROR: x86 emulation currently requires hardware acceleration!Please ensure Intel HAXM is