AMLoadingSpinner 1.0

AMLoadingSpinner 1.0

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最新发布2017年8月

Mihaylov Artem 维护。



  • Mihaylov Artem

AMLoadingSpinner 是显示正在执行的任务进度的一个简单的方法来展示动画旋转器。

入门

手动

AMLoadingSpinner/AMLoadingSpinner 文件夹拖入您的项目。

用法

AMLoadingSpinner 是一个单例,它将始终作为应用程序主窗口的全屏子视图来显示。这个旋转器没有默认的动画,因此您需要有一组动画图片(图片数组的序列)来使用它。

自定义

前景

必需的
+(void) setAnimationImages:(NSArray <UIImage *>*)images;

您可以通过此方法传递一个包含单个对象数组的参数来获取不带动画的静态图像。

可选的
+(void) setAnimationDuration:(NSTimeInterval)duration;   // Default is 5.0 seconds
+(void)setForegroundImageViewSize:(CGSize)size;          // Default is (100, 100)

请注意,旋转器始终显示在屏幕中间。

背景

您可以选择旋转器背景视图的类型。背景类型是枚举 AMLoadingSpinnerBackgroundType,它有 4 个值

AMLoadingSpinnerBackgroundTypeFullScreen    // Full-screen background view                   
AMLoadingSpinnerBackgroundTypeClear         // Background view is not shown
AMLoadingSpinnerBackgroundTypeDefaultView   // Background view is rectangle or square
AMLoadingSpinnerBackgroundTypeCustomView    // Custom background view

您可以使用以下方法自定义背景视图

可选的
+(void) setBackgroundType:(AMLoadingSpinnerBackgroundType)type;   // Default is AMLoadingSpinnerBackgroundTypeClear

//Works ONLY when for AMLoadingSpinnerBackgroundTypeCustomView type
+(void) setBackgroundView:(UIView *)view;

//Works ONLY when for AMLoadingSpinnerBackgroundTypeDefaultView type
+(void) setBackgroundViewSize:(CGSize)size;               // Default is (200, 200)
+(void) setBackgroundViewCornerRadius:(CGFloat)radius;    // Default is 10.0

//Works ONLY when for AMLoadingSpinnerBackgroundTypeDefaultView and AMLoadingSpinnerBackgroundTypeFullScreen types
+(void) setBackgroundViewColor:(UIColor *)color;       // Default is (255, 255, 255, 0.7)

动作

要显示/隐藏旋转器,请使用以下方法

显示

+(void) show;                                
+(void) showWithProgress:(CGFloat)progress;

取消显示

+(void) dismiss;                                  
+(void) dismissWithDelay:(NSTimeInterval)delay;

注意,在旋转器显示时,用户与应用程序的交互将禁用。

许可证

AMLoadingSpinnerMIT 许可证 的条款和条件下分发。

鸣谢

AMLoadingSpinnerArtem Mihaylov 开发。如果您在项目中使用了 AMLoadingSpinner,对软件归属的认可将会非常感激。