JCCloudProgressView
示例
JCCloudProgressView是一款具有精美图形的进度指示视图。
要求
JCCloudProgressView
在iOS 8+上运行,需要ARC编译。它依赖于以下苹果框架
Foundation.framework UIKit.framework CoreGraphics.framework
安装
JCCloudProgressView
通过CocoaPods提供。要安装它,只需将以下行添加到您的Podfile中
pod 'JCCloudProgressView'
然后运行pod install
如何使用
故事板
您可以通过以下步骤在故事板中创建一个 JCCloudProgressView
:
- 将一个 UIView 拖动到您的故事板中
- 将 UIView 类更改为
JCCloudProgressView
- 现在您应该在故事板中看到一个 JCCloudProgressView。
- 更改右侧面板中的属性。
使用代码创建
当然,您也可以使用代码来创建 JCCloudProgressView。
#import "JCCloudProgressView.h"
// Create a JCCloudProgressView
JCCloudProgressView *progressView = [[JCCloudProgressView alloc] init];
参数
/**
* Cloud layer fill color.
* Default is [UIColor colorWithRed:0.9 green: 0.9 blue:0.9 alpha:1].
*/
@property (strong, nonatomic) IBInspectable UIColor *cloudColor;
/**
* Gradient color A at location [0, 0]
* Default is [UIColor colorWithRed:1 green:0 blue:0 alpha:0.5].
*/
@property (strong, nonatomic) IBInspectable UIColor *colorA;
/**
* Gradient color B at location [1, 1]
* Default is [UIColor colorWithRed:0 green:0 blue:1 alpha:0.5].
*/
@property (strong, nonatomic) IBInspectable UIColor *colorB;
/**
* Progress level. From 0.0 to 1.0. Default is 0.0.
*/
@property (assign, nonatomic) IBInspectable double progress;
方法
/**
* Start the wave layers animation.
*
* @note This method adds CABasicAnimation to both wave layers.
*/
- (void)startWaveRollingAnimation;
/**
* Start the wave layers animation.
*
* @note This method removes CABasicAnimation to both wave layers.
*/
- (void)stopWaveRollingAnimation;
/**
* Update the progress without animation.
*
* @param progress From 0.0 to 1.0.
*/
- (void)updateProgress:(double)progress;
/**
* Update the progress.
*
* @param progress From 0.0 to 1.0.
* @param animated Animated the progress update. YES or NO.
*/
- (void)updateProgress:(double)progress animated:(BOOL)animated;
作者
JasonHan1990, [邮箱地址隐藏]
许可证
JCCloudProgressView 在 MIT 许可下可用。更多信息请参阅 LICENSE 文件。