1:父类
继承于UIView
2: 属性
//进度条的样式, 默认是UIProgressViewStyleDefault, 二者几乎没有什么区别
@property(nonatomic) UIProgressViewStyle progressViewStyle;
进度条的样式是一个枚举
typedef NS_ENUM(NSInteger, UIProgressViewStyle) {
UIProgressViewStyleDefault,
UIProgressViewStyleBar __TVOS_PROHIBITED,
};
//范围是0.0-1.0, 默认是0.0
@property(nonatomic) float progress;
//已加载部分颜色
@property(nonatomic, strong, nullable) UIColor* progressTintColor;
//未加载部分的颜色
@property(nonatomic, strong, nullable) UIColor* trackTintColor;
@property(nonatomic, strong, nullable) UIImage* progressImage;
@property(nonatomic, strong, nullable) UIImage* trackImage;
@property(nonatomic, strong, nullable) NSProgress *observedProgress;
3: 方法
- (instancetype)initWithFrame:(CGRect)frame;
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder;
//根据样式设置视图高度
- (instancetype)initWithProgressViewStyle:(UIProgressViewStyle)style;
//设置进度
- (void)setProgress:(float)progress animated:(BOOL)animated;
网友评论