-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.m
More file actions
140 lines (110 loc) · 5.04 KB
/
ViewController.m
File metadata and controls
140 lines (110 loc) · 5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//
// ViewController.m
// LevelProgressView
//
// Created by 牛清旭 on 2018/9/4.
// Copyright © 2018年 牛清旭. All rights reserved.
//
#import "ViewController.h"
#import "LevelProgressView.h"
#define VMRGBAColor(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
@interface ViewController ()
@property(nonatomic ,strong) LevelProgressView *progressView;
@property(nonatomic ,strong) UIScrollView *backView;
@property(nonatomic ,strong) LevelProgressView *progressView2;
@property(nonatomic ,strong) UIScrollView *backView2;
@property(nonatomic ,strong) LevelProgressView *progressView3;
@property(nonatomic ,strong) UIScrollView *backView3;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setupUI];
}
- (void)setupUI{
// ***************************************************************
// level背景滚动scrollview
self.backView.contentSize = CGSizeMake(self.view.frame.size.width*2+100, 100);
self.backView.frame = CGRectMake(0, 100, self.view.frame.size.width, 100);
self.backView.showsHorizontalScrollIndicator = NO;
self.backView.showsVerticalScrollIndicator = NO;
// self.backView.scrollEnabled = NO;
[self.view addSubview:self.backView];
NSArray *levelArray = @[ @"客户专员", @"客户经理", @"中级客户经理", @"高级客户经理", @"特级客户经理"];
self.progressView = [[LevelProgressView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width*1.7, 100)];
[self.backView addSubview:self.progressView];
self.progressView.stateArray = levelArray;
self.progressView.color = VMRGBAColor(255,125,37,1);
self.progressView.tintColor = VMRGBAColor(204,204,204,1);
self.progressView.needBigText = 1;
self.progressView.needShiXin = 2;
self.progressView.changeColor = 1;
self.progressView.textOffsetY = -25;
self.progressView.cycleOffsetY = 40;
self.progressView.half = 0.5;
self.progressView.color = VMRGBAColor(226,69,66,1);
NSInteger level;
level = 3;
self.progressView.currentState = (int)level; // 第几个等级
[self.backView setContentOffset:CGPointMake(self.view.frame.size.width/3*(level-1)+level*1.2,0) animated:YES];
// ***************************************************************
self.backView2.contentSize = CGSizeMake(self.view.frame.size.width*2+100, 100);
self.backView2.frame = CGRectMake(0, 300, self.view.frame.size.width, 100);
self.backView2.showsHorizontalScrollIndicator = NO;
self.backView2.showsVerticalScrollIndicator = NO;
[self.view addSubview:self.backView2];
self.progressView2 = [[LevelProgressView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width*1.7, 100)];
[self.backView2 addSubview:self.progressView2];
self.progressView2.stateArray = @[ @"客户专员", @"客户经理", @"中级客户经理", @"高级客户经理", @"特级客户经理"];
self.progressView2.color = VMRGBAColor(255,125,37,1);
self.progressView2.tintColor = VMRGBAColor(204,204,204,1);
self.progressView2.needBigText = 2;
self.progressView2.needShiXin = 1;
self.progressView2.currentState = (int)(level);
// ***************************************************************
// level背景滚动scrollview
self.backView3.contentSize = CGSizeMake(self.view.frame.size.width*2+100, 100);
self.backView3.frame = CGRectMake(0, 450, self.view.frame.size.width, 100);
self.backView3.showsHorizontalScrollIndicator = NO;
self.backView3.showsVerticalScrollIndicator = NO;
[self.view addSubview:self.backView3];
self.progressView3 = [[LevelProgressView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width*1.7, 100)];
[self.backView3 addSubview:self.progressView3];
self.progressView3.stateArray = levelArray;
self.progressView3.color = VMRGBAColor(255,125,37,1);
self.progressView3.tintColor = VMRGBAColor(204,204,204,1);
self.progressView3.needBigText = 2;
self.progressView3.needShiXin = 2;
self.progressView3.changeColor = 1;
self.progressView3.textOffsetY = -25;
self.progressView3.cycleOffsetY = 40;
self.progressView3.half = 0.5;
self.progressView3.color = VMRGBAColor(226,69,66,1);
self.progressView3.currentState = (int)level; // 第几个等级
[self.backView3 setContentOffset:CGPointMake(self.view.frame.size.width/3*(level-1)+level*1.2,0) animated:YES];
// ***************************************************************
}
#pragma mark - Lazy
- (UIScrollView *)backView{
if (!_backView) {
_backView = [[UIScrollView alloc] init];
}
return _backView;
}
- (UIScrollView *)backView2{
if (!_backView2) {
_backView2 = [[UIScrollView alloc] init];
}
return _backView2;
}
- (UIScrollView *)backView3{
if (!_backView3) {
_backView3 = [[UIScrollView alloc] init];
}
return _backView3;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end