UIProgressView进度条方法总结
2015-09-24 14:35
495 查看
初始化一个进度条:
(instancetype)initWithProgressViewStyle:(UIProgressViewStyle)style;
注意:1.用这个方式初始化的进度条系统会默认给一个长度。
1
2
3
4
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.风格枚举如下:
1
2
3
4
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;
相关文章推荐
- 网页性能管理详解:浅谈chrome-Timeline及window.requestAnimationFrame()方法
- OpenStack: Perform Consistent Snapshots With Qemu Guest Agent
- 字符串0.在php和js中转换为布尔类型 值是false还是true
- iOS之UITableView
- setRequestedOrientation设置屏幕方向
- 如何使用xib自定义UITableViewCell
- Android UI设计
- 重写UITabBar 关键步骤小结
- 14-EMM Procedure 4. Service Request
- Android 异步查询框架AsyncQueryHandler的使用
- Number Sequence---hdu1711(kmp)
- UILabel UiButton 文字下面加下划线
- UILabel,UITextField 以及UIButton应用
- Liferay中request
- leetcode 95-96:Unique Binary Search Trees
- <s:checkbox> fieldValue取值问题
- Introduction to Java Programming编程题8.37<Guess the capitals>
- White spaces are required between publicId and systemId
- Jenkins-svn: E175002: OPTIONS request failed on URL
- easyui tabs中打开新的tabs关闭当前tabs