Browse Source

下拉代码

wangwei 6 years ago
parent
commit
0974370866

+ 1 - 1
CAISHEN/SellPhone2/Home/AssessPage/Controller/KXAssessComputerViewController.m

@@ -269,7 +269,7 @@ static NSString *cellID = @"cellID";
269 269
     
270 270
     [KXHTTP post:urlString params:paramsDict success:^(id json) {
271 271
         NSLog(@"%@", json);
272
-//        [self.navigationController popViewControllerAnimated:YES];
272
+        [self.navigationController popViewControllerAnimated:YES];
273 273
     } failure:^(NSError *error) {
274 274
         [MBProgressHUD showTip:@"网络错误"];
275 275
     }];

+ 16 - 0
CAISHEN/SellPhone2/Home/AssessPage/Controller/KXAssessViewController.m

@@ -12,6 +12,8 @@
12 12
 #import "KXAssessComputerViewController.h"   //电脑评估
13 13
 #import "KXAssessPadViewController.h"        //平板评估
14 14
 
15
+#import "UIImage+WWGradientColor.h"  //渐变色
16
+
15 17
 @interface KXAssessViewController ()
16 18
 
17 19
 @property (nonatomic, strong)UISegmentedControl *segment;  //多段选择器
@@ -44,6 +46,11 @@
44 46
             }
45 47
         }
46 48
     }
49
+    
50
+    UIColor *topColor = WWColor(219, 141, 255, 1);
51
+    UIColor *bottomColor = WWColor(233, 202, 248, 1);
52
+    UIImage *bgImg = [UIImage gradientColorImageFromColors:@[topColor, bottomColor] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(SCREEN_WIDTH, 64)];
53
+    self.navigationController.navigationBar.barTintColor = [UIColor colorWithPatternImage:bgImg];
47 54
 }
48 55
 
49 56
 - (void)popAction {
@@ -95,6 +102,15 @@
95 102
 #pragma mark - 创建主界面
96 103
 - (void)createrMainUI {
97 104
     self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
105
+    
106
+    UIView *topView = [[UIView alloc] initWithFrame:CGRectMake(0, -1, SCREEN_WIDTH, 40)];
107
+    
108
+    UIColor *topColor = WWColor(233, 202, 248, 1);
109
+    UIColor *bottomColor = [UIColor groupTableViewBackgroundColor];
110
+    UIImage *bgImg = [UIImage gradientColorImageFromColors:@[topColor, bottomColor] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(SCREEN_WIDTH, 40)];
111
+    topView.backgroundColor = [UIColor colorWithPatternImage:bgImg];
112
+    [self.view addSubview:topView];
113
+    
98 114
     [self.view addSubview:self.segment];
99 115
     [self onClickSegment];
100 116
 }

+ 23 - 10
CAISHEN/SellPhone2/Home/HomePage/Controller/KXSPHomeViewController.m

@@ -26,7 +26,7 @@ static NSString *cellID = @"cellID";
26 26
 
27 27
 - (UITableView *)tableView {
28 28
     if (!_tableView) {
29
-        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - NavHeight - TabbarHeight) style:UITableViewStylePlain];
29
+        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, -1, SCREEN_WIDTH, SCREEN_HEIGHT - NavHeight - TabbarHeight) style:UITableViewStylePlain];
30 30
         _tableView.delegate = self;
31 31
         _tableView.dataSource = self;
32 32
         [_tableView registerNib:[UINib nibWithNibName:@"KXSPHomeViewCell" bundle:nil] forCellReuseIdentifier:cellID];
@@ -124,20 +124,24 @@ static NSString *cellID = @"cellID";
124 124
     [self.view addSubview:self.tableView];
125 125
 }
126 126
 
127
+- (void)viewWillAppear:(BOOL)animated {
128
+    [super viewWillAppear:animated];
129
+    
130
+    self.navigationController.navigationBar.barTintColor = WWColor(219, 141, 255, 1);
131
+}
132
+
127 133
 #pragma mark - 创建导航栏
128 134
 - (void)createNaviBar {
129 135
     NSString *appName = [NSString getAppName];
130 136
     self.name = appName;
131 137
     
132
-//    for (UIView *views in self.navigationController.navigationBar.subviews) {
133
-//        for (UIView *view in views.subviews) {
134
-//            if ([view isKindOfClass:[UIImageView class]]) {
135
-//                view.hidden = YES;
136
-//            }
137
-//        }
138
-//    }
139
-    
140
-    self.navigationController.navigationBar.barTintColor = WWColor(219, 141, 255, 1);
138
+    for (UIView *views in self.navigationController.navigationBar.subviews) {
139
+        for (UIView *view in views.subviews) {
140
+            if ([view isKindOfClass:[UIImageView class]]) {
141
+                view.hidden = YES;
142
+            }
143
+        }
144
+    }
141 145
 }
142 146
 
143 147
 #pragma mark - tableView dataSource
@@ -167,6 +171,15 @@ static NSString *cellID = @"cellID";
167 171
     return cell;
168 172
 }
169 173
 
174
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
175
+    if (scrollView == self.tableView) {
176
+        CGFloat offY = scrollView.contentOffset.y;
177
+        if (offY < 0) {
178
+            scrollView.contentOffset = CGPointZero;   
179
+        }
180
+    }
181
+}
182
+
170 183
 #pragma mark - 点击最底部质检标准图片
171 184
 - (void)onClickBottomImage {
172 185
     NSLog(@"你点击了我");