UIActivityIndicatorView
(1)继承UIView,使用activity indicator指示一个任务正在进行中,展现为旋转的小菊花,
Initializing an Activity Indicator
- initWithActivityIndicatorStyle:
Managing an Activity Indicator
- startAnimating
stopAnimating
- isAnimating
hidesWhenStopped
Configuring the Activity Indicator Appearance
activityIndicatorViewStyle Property
color Property
Data Types
UIActivityIndicatorViewStyle
typedef enum {
UIActivityIndicatorViewStyleWhiteLarge,
UIActivityIndicatorViewStyleWhite,
UIActivityIndicatorViewStyleGray,
} UIActivityIndicatorViewStyle;
使用
首先声明一个,然后初始化配置
activityIndicator3 = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 32.0f, 32.0f)];
[activityIndicator3 setCenter:viewLoading3.center];
[activityIndicator3 setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];
[viewLoading3 addSubview:activityIndicator3];
activityIndicator3.color=[UIColor blackColor];
[activityIndicator3 startAnimating];
用完之后调用 stopAnimating