NS_CLASS_AVAILABLE_IOS(2_0) @interface UIActivityIndicatorView : UIView <NSCoding>
// 初始化并设置风格
- (instancetype)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style NS_DESIGNATED_INITIALIZER;
// 初始化并设置位置和大小
- (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
// 初始化并设置nib
- (instancetype) initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
// 指示器的风格
@property(nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
// 当指示器隐藏时是否停止
@property(nonatomic) BOOL hidesWhenStopped; // default is YES.
// 活动指示器的颜色
@property (nullable, readwrite, nonatomic, strong) UIColor *color NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
// 启动活动指示器动画
- (void)startAnimating;
// 停止活动指示器动画
- (void)stopAnimating;
// 是否开启动画
#if UIKIT_DEFINE_AS_PROPERTIES
@property(nonatomic, readonly, getter=isAnimating) BOOL animating;
#else
- (BOOL)isAnimating;
#endif
@end
// 活动指示器的风格
typedef NS_ENUM(NSInteger, UIActivityIndicatorViewStyle) {
UIActivityIndicatorViewStyleWhiteLarge,
UIActivityIndicatorViewStyleWhite,
UIActivityIndicatorViewStyleGray __TVOS_PROHIBITED,
};
网友评论