本文主要是介绍UIActivityIndicatorView官方文档及使用,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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
这篇关于UIActivityIndicatorView官方文档及使用的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!