第七篇 - UIActivityIndicatorView

初始化

UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];

 

 

//NS_ASSUME_NONNULL_BEGIN
//
typedef NS_ENUM(NSInteger, UIActivityIndicatorViewStyle) {
    //大 白色
    UIActivityIndicatorViewStyleWhiteLarge,
    //小 白色
    UIActivityIndicatorViewStyleWhite,
    //小 灰黑
    UIActivityIndicatorViewStyleGray __TVOS_PROHIBITED,
};
//
//NS_CLASS_AVAILABLE_IOS(2_0) @interface UIActivityIndicatorView : UIView <NSCoding>
//
- (instancetype)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style NS_DESIGNATED_INITIALIZER; // sizes the view according to the style
// 大小是固定的
- (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;

- (instancetype) initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
//
//设置样式
@property(nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; // default is UIActivityIndicatorViewStyleWhite
//设置指示器是否停止动画时隐藏
@property(nonatomic) BOOL                         hidesWhenStopped;           // default is YES. calls -setHidden when animating gets set to NO

//设置指示器颜色
@property (nullable, readwrite, nonatomic, strong) UIColor *color NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;

//让指示器开始动画
- (void)startAnimating;
//让指示器停止动画
- (void)stopAnimating;
//指示器是否在转
- (BOOL)isAnimating;
//
@end

 

posted @ 2016-03-17 16:05  人生路1/5  阅读(133)  评论(0编辑  收藏  举报