Activity
是一个 UIView
子类,用于创建可定制的加载指示器控件。
pod 'Activity'
配置 Activity 和以下示例一样简单
Activity* activity = [[Activity alloc] initWithStyle:ActivityStyleAppStoreBlue];
activity.frame = CGRectMake(50, 50, 30, 30);
[self.view addSubview:activity];
[activity startAnimating];
Activity 将从这里接管。您只需要知道如何开始/停止动画。
Activity 提供了一组属性,以便按需要对其进行定制 :-
style
: 从 'StyleActivity' 枚举中选择适合您的样式
ringTintColor
: 显示为加载圆环的颜色
circulatorTintColor
: 遍历圆环周长的圆形小色环的颜色
ringThickness
: 圆环的厚度(默认:1)
ringSize
: 圆环的直径(默认:28)
durationForOneRevolution
: 完成一次旋转所需的时间。(默认:1)
Given that UIColor is capable of color patterns handling made from images,
Activity can be used to take advantage of this feature.
Demo app includes almost all of the property usages through a pretty basic example.
You can go through it to see these in action at first.