活动 1.0

活动 1.0

测试测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2014年12月

Tarun Tyagi 维护。



活动 1.0

  • Tarun Tyagi

Activity - iOS (Objective-C)

Activity 是一个 UIView 子类,用于创建可定制的加载指示器控件。

  • 模仿了 App Store 和 Music 中的 Apple 加载指示器

要求

  • iOS 7.0 或更高版本。 (使用 UIKit Dynamics)
  • QuartzCore.framework
  • 启用 ARC。

安装

  • 想要一个 Pod,只需将以下行添加到 podfile 中-
pod 'Activity'
  • 您可以直接从 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)

使用 [UIColor colorWithPatternImage:] 的优势

Given that UIColor is capable of color patterns handling made from images, 
Activity can be used to take advantage of this feature.

外观如何

Screenshot

示例应用

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.