// 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