iOS UIKit框架学习—UIActivityIndicatorView 发表于 2017-01-25 | 分类于 iOS | | 阅读次数: 使用活动指示灯显示任务进行过程中。活动指示灯显示为一个”齿轮”,是旋转或停止。 1234567891011121314151617181920212223242526272829303132NS_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, };