// wsqflyWaveProgressView.h
//
//
// Created by webapps on 2017/4/13.
// Copyright © 2017年 tanyang. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, WSQWaveProgressViewType) {
WSQWaveProgressViewTypeUP = 0, //上升
WSQWaveProgressViewTypeDOWN = 1 //下降
};
@interface wsqflyWaveProgressView :UIView
//添加一些说明之类的
@property (nonatomic,strong)UIImageView *backgroundImageView;
@property (nonatomic,strong)UILabel *percentLabel;
@property (nonatomic,strong)UILabel *instructionsLabel;
@property (nonatomic,copy)NSString *AirImageName;//气泡名
@property (nonatomic,strong)UIImageView *AirImage;//气泡
/**
调用此句开始绘制
@param layerColor_1 水波浪颜色1
@param layerColor_2 水波浪颜色2
@param percent 百分比
@param type 类型(上升还是下降)
*/
-(void)starToDrawWithLayerColor_1:(UIColor *)layerColor_1 andLayerColor_2:(UIColor *)layerColor_2 andPercent:(CGFloat)percent andType:(WSQWaveProgressViewType)type;
/**
开启泡泡
*/
-(void)startAirPaoPao;
/**
停止泡泡
*/
-(void)stopAirPaoPao;
//
// wsqflyWaveProgressView.m
//
//
// Created by webapps on 2017/4/13.
// Copyright © 2017年 tanyang. All rights reserved.
//
#import "wsqflyWaveProgressView.h"
@interface wsqflyWaveProgressView ()
@property (nonatomic, strong) UIColor *waveColor_1; // 第一个波浪颜色
@property (nonatomic, strong) UIColor *waveColor_2; // 第二个波浪颜色
@property (nonatomic, assign) CGFloat percent; // 百分比
@property (nonatomic, assign) CGFloat isUp; // 上升的模式(1 升 ,0 降)
//给viewe 添加layer 添加两个是为了形成交叉点波浪
@property (nonatomic, strong) CAShapeLayer *layer_1;
@property (nonatomic, strong) CAShapeLayer *layer_2;
更多详细代码(完整dome):http://download.csdn.net/detail/qq_33646395/9813987