【UIKit】-4-UIActivityIndicatorView - 系统转菊花

官方解释(转菊花,不常用)
Use an activity indicator to show that a task is in progress. An activity indicator appears as a “gear” that is either spinning or stopped. You control when an activity indicator animates by calling the startAnimating and stopAnimating methods. To automatically hide the activity indicator when animation stops, set the hidesWhenStopped property to YES. Starting in iOS 5.0, you can set the color of the activity indicator by using the color property. For more information about appearance and behavior configuration, see Activity Indicators.
使用一个活动的指标,以表明一个任务正在进行中。活动指示器显示为一个“齿轮”要么是旋转或停止。您可以控制​​在一个活动指标动画致电startAnimating和stopAnimating方法。为自动隐藏,当动画停止活动的指标,设置hidesWhenStopped属性为YES。在开始的iOS 5.0,您可以通过使用颜色属性设置活动指示灯的颜色。有关外观和行为配置的详细信息,请参见活动的指标。

typedef NS_ENUM(NSInteger,UIActivityIndicatorViewStyle) {

   UIActivityIndicatorViewStyleWhiteLarge,

   UIActivityIndicatorViewStyleWhite,

   UIActivityIndicatorViewStyleGray,

};

- (instancetype)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style;    

 

@property(nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;

@property(nonatomic) BOOL                         hidesWhenStopped;          

@property (readwrite, nonatomic, retain) UIColor *color NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;

 

- (void)startAnimating;

- (void)stopAnimating;

- (BOOL)isAnimating;


示例

    UIActivityIndicatorView *act =[[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(111, 111, 111, 111)];

    [act setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhiteLarge];

    act.color = [UIColor yellowColor];

    [self.view addSubview:act];

   [act startAnimating];





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值