Commit cff96300 authored by admin's avatar admin

完成巡检列表UI 详情完成部分

parent 16252f9d
......@@ -10,6 +10,7 @@
2381E9EBA834CB171E43657A /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 083F3F95EB690FA24FEC0C8E /* libPods.a */; };
840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 840ABECB1BE1C29F006E49C5 /* RankDetailViewController.m */; };
840ABECF1BE20A53006E49C5 /* RankShopDetialCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 840ABECE1BE20A53006E49C5 /* RankShopDetialCell.m */; };
841BBCDE1BE49E18007A21BF /* RankWorkDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 841BBCDD1BE49E18007A21BF /* RankWorkDetailCell.m */; };
8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */; };
8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474A01B1BE368D700315F30 /* HomeCellItem.m */; };
84846E971BE069BC0010550A /* DateButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 84846E961BE069BC0010550A /* DateButton.m */; };
......@@ -66,6 +67,8 @@
840ABECB1BE1C29F006E49C5 /* RankDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankDetailViewController.m; sourceTree = "<group>"; };
840ABECD1BE20A53006E49C5 /* RankShopDetialCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankShopDetialCell.h; sourceTree = "<group>"; };
840ABECE1BE20A53006E49C5 /* RankShopDetialCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankShopDetialCell.m; sourceTree = "<group>"; };
841BBCDC1BE49E18007A21BF /* RankWorkDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankWorkDetailCell.h; sourceTree = "<group>"; };
841BBCDD1BE49E18007A21BF /* RankWorkDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankWorkDetailCell.m; sourceTree = "<group>"; };
8442BA5A1BDB8FDB005E5657 /* MineTableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineTableHeaderView.h; sourceTree = "<group>"; };
8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineTableHeaderView.m; sourceTree = "<group>"; };
8474A01A1BE368D700315F30 /* HomeCellItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeCellItem.h; sourceTree = "<group>"; };
......@@ -380,6 +383,8 @@
children = (
840ABECD1BE20A53006E49C5 /* RankShopDetialCell.h */,
840ABECE1BE20A53006E49C5 /* RankShopDetialCell.m */,
841BBCDC1BE49E18007A21BF /* RankWorkDetailCell.h */,
841BBCDD1BE49E18007A21BF /* RankWorkDetailCell.m */,
);
path = Cell;
sourceTree = "<group>";
......@@ -911,6 +916,7 @@
8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */,
84D8257F1BDD2F7E00CC61F7 /* MineTableFooterView.m in Sources */,
84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */,
841BBCDE1BE49E18007A21BF /* RankWorkDetailCell.m in Sources */,
848699B31BDF810900859DFE /* InspectTaskViewController.m in Sources */,
848699B11BDF810900859DFE /* MenuButton.m in Sources */,
840ABECF1BE20A53006E49C5 /* RankShopDetialCell.m in Sources */,
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "filter_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "filter_icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sort_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "sort_icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@
#ifndef Constant_h
#define Constant_h
#define kNavigationBarColor [UIColor colorWithRed:12 / 255.0 green:89/255.0 blue:172/255.0 alpha:1.0]
#define kNavigationBarColor [UIColor colorWithRed:0 / 255.0 green:111 / 255.0 blue:188 / 255.0 alpha:1.0]
#define kRemindTextColor [UIColor colorWithRed:133 / 255.0 green:133/255.0 blue:133/255.0 alpha:1.0]
#define kMineBackGroundColor [UIColor colorWithRed:243 / 255.0 green:243 / 255.0 blue:243 / 255.0 alpha:1.0]
#define kHomeSectionButtonTextColor [UIColor colorWithRed:186 / 255.0 green:186 / 255.0 blue:186 / 255.0 alpha:1.0]
......@@ -59,6 +59,30 @@
// #fe6903
#define kGradeNumberTextColor [UIColor colorWithRed:254 / 255.0 green:105 / 255.0 blue:3 / 255.0 alpha:1.0]
// RankingDetail
// #444444
#define kDetailSection0TitleColor [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
// #999999
#define kDetailSection1TitleColor [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1.0]
// #999999
#define kDetailSmallTitleColor [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1.0]
// #444444
#define kDetailBigTitleColor [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
// InspectList
// #f3f3f3
#define kInspectSectionBackGroundColor [UIColor colorWithRed:243 / 255.0 green:243 / 255.0 blue:243 / 255.0 alpha:1.0]
#define kInspectSectionButtonTextColor [UIColor colorWithRed:97 / 255.0 green:97 / 255.0 blue:97 / 255.0 alpha:1.0]
#define kCellTitleColor [UIColor colorWithRed:53 / 255.0 green:53 / 255.0 blue:53 / 255.0 alpha:1.0]
#define kCellDetailColor [UIColor colorWithRed:83 / 255.0 green:83 / 255.0 blue:83 / 255.0 alpha:1.0]
#define kProgressUnSettledColor [UIColor colorWithRed:255 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:1.0]
#define kProgressDealWithColor [UIColor colorWithRed:49 / 255.0 green:57 / 255.0 blue:126 / 255.0 alpha:1.0]
#define kProgressOverDueColor [UIColor colorWithRed:117 / 255.0 green:117 / 255.0 blue:117 / 255.0 alpha:1.0]
#define kProgressViewAllBackColor [UIColor colorWithRed:244 / 255.0 green:244 / 255.0 blue:244 / 255.0 alpha:1.0]
#define kProgressViewAlreadyBackColor [UIColor colorWithRed:112 / 255.0 green:120 / 255.0 blue:216 / 255.0 alpha:1.0]
#import "UIView+Extension.h"
#endif /* Constant_h */
......@@ -7,14 +7,23 @@
//
#import <UIKit/UIKit.h>
typedef enum ProgressState : NSUInteger {
ProgressStateUnSettled = 0,// 未处理
ProgressStateDealWith, // 处理中
ProgressStateOverDue // 已过期
} ProgressState;
@interface InspectListCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; // 标题
@property (nonatomic, strong) UILabel *startDate; // 起始日期
@property (nonatomic, strong) UILabel *overDate; // 截止日期
@property (nonatomic, strong) UILabel *checkPointLabel; // 检查点
@property (nonatomic, strong) UILabel *completeLabel; // 已完成
@property (nonatomic, strong) UIProgressView *progressView; // 进度条
@property (nonatomic, strong) UILabel *progressLabel; // 进度
@property (nonatomic, strong) UILabel *taskStateLabel; // 任务的状态
@property (nonatomic, assign) ProgressState progressState; // 处理进度
@property (nonatomic, strong) UILabel *alreadyLabel;
@property (nonatomic, strong) UILabel *allLabel;
@property (nonatomic, assign) CGFloat multiplier; // 乘数
@property (nonatomic, strong) UIView *alreadyView;
@property (nonatomic, strong) UIView *allView;
@end
......@@ -14,12 +14,12 @@
{
CGFloat w = self.frame.size.width;
CGFloat h = self.frame.size.height;
return CGRectMake(w / 2 - 40, 0, 40, h);
return CGRectMake(w / 2 - 30, 0, 32, h);
}
- (CGRect)imageRectForContentRect:(CGRect)contentRect;
{
CGFloat w = self.frame.size.width;
return CGRectMake(w / 2, 7, 26, 26);
return CGRectMake(w / 2 + 3, 15, 13, 15);
}
- (void)setHighlighted:(BOOL)highlighted {
......
......@@ -16,6 +16,13 @@
@interface InspectListViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *test1Array;
@property (nonatomic, strong) NSArray *test2Array;
@property (nonatomic, strong) NSArray *test3Array;
@property (nonatomic, strong) NSArray *test4Array;
@property (nonatomic, strong) NSArray *test5Array;
@property (nonatomic, strong) NSArray *test6Array;
@end
@implementation InspectListViewController
......@@ -30,6 +37,15 @@
self.navigationItem.titleView = customLab;
[self.tableView registerClass:[InspectListCell class] forCellReuseIdentifier:kInspectListCell];
//
self.test1Array = [NSArray arrayWithObjects:@"2015年9月口碑巡检",@"2015年9月卫生专项巡检",@"2015年9月真北店安全临时巡检",@"2015年10月卫生专项巡检",@"2015年10月设备安全巡检", nil];
self.test2Array = [NSArray arrayWithObjects:@"2015-09-01 10:28:52",@"2015-09-08 12:47:32",@"2015-10-21 07:58:22",@"2015-10-09 19:08:52",@"2015-09-01 14:19:52", nil];
self.test3Array = [NSArray arrayWithObjects:@"2015-09-03",@"2015-09-15",@"2015-10-22",@"2015-11-02",@"2015-11-05", nil];
self.test4Array = [NSArray arrayWithObjects:@"2",@"3",@"1",@"2",@"1", nil];
self.test5Array = [NSArray arrayWithObjects:@(5),@(12),@(0),@(8),@(20), nil];
self.test6Array = [NSArray arrayWithObjects:@(16),@(25),@(20),@(100),@(20), nil];
}
- (void)viewWillAppear:(BOOL)animated
......@@ -47,7 +63,7 @@
#pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 7;
return 5;
}
// cell显示的内容
......@@ -58,12 +74,23 @@
cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectListCell];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.titleLabel.text = @"2015年9月口碑巡检";
cell.startDate.text = @"起始时间:2015-09-01";
cell.overDate.text = @"起始时间:2015-09-01";
cell.checkPointLabel.text = @"16个检查点";
cell.completeLabel.text = @"| 完成数:10";
cell.progressLabel.text = @"60%";
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _test1Array[indexPath.row]];
cell.startDate.text = [NSString stringWithFormat:@"起始时间:%@", _test2Array[indexPath.row]];
cell.overDate.text = [NSString stringWithFormat:@"截止时间:%@", _test3Array[indexPath.row]];
if ([_test4Array[indexPath.row] isEqualToString:@"1"]) {
cell.progressState = ProgressStateUnSettled;
} else if ([_test4Array[indexPath.row] isEqualToString:@"2"]) {
cell.progressState = ProgressStateDealWith;
} else {
cell.progressState = ProgressStateOverDue;
}
cell.alreadyLabel.text = [NSString stringWithFormat:@"%@", _test5Array[indexPath.row]];
cell.allLabel.text = [NSString stringWithFormat:@"/%@", _test6Array[indexPath.row]];
CGFloat already = [_test5Array[indexPath.row] floatValue];
CGFloat all = [_test6Array[indexPath.row] floatValue];
cell.multiplier = already / all;
cell.allView.backgroundColor = kProgressViewAllBackColor;
cell.alreadyView.backgroundColor = kProgressViewAlreadyBackColor;
return cell;
}
......@@ -77,13 +104,13 @@
// cell的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 150;
return 145;
}
// section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 40;
return 45;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
......@@ -97,14 +124,14 @@
// 创建sectionView
UIView *sectionView = [[UIView alloc] init];
sectionView.userInteractionEnabled = YES;
sectionView.backgroundColor = [UIColor whiteColor];
sectionView.backgroundColor = kInspectSectionBackGroundColor;
UIView *lineView = [[UIView alloc] init];
lineView.translatesAutoresizingMaskIntoConstraints = NO;
lineView.backgroundColor = [UIColor blackColor];
lineView.backgroundColor = kSeparateLineColor;
[sectionView addSubview:lineView];
NSLayoutConstraint *lineTop = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
NSLayoutConstraint *lineTop = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[sectionView addConstraint:lineTop];
NSLayoutConstraint *lineLeft = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-0.5];
......@@ -113,22 +140,22 @@
NSLayoutConstraint *lineWidth = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:1];
[sectionView addConstraint:lineWidth];
NSLayoutConstraint *lineBottom = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
NSLayoutConstraint *lineBottom = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[sectionView addConstraint:lineBottom];
MenuButton *taxiButton = [[MenuButton alloc] init];
taxiButton.translatesAutoresizingMaskIntoConstraints = NO;
[taxiButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[taxiButton setImage:[UIImage imageNamed:@"tabbar_discover"] forState:UIControlStateNormal];
taxiButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
[taxiButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
[taxiButton setImage:[UIImage imageNamed:@"sort_icon"] forState:UIControlStateNormal];
taxiButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
[taxiButton setTitle:@"排序" forState:UIControlStateNormal];
[sectionView addSubview:taxiButton];
MenuButton *screenButton = [[MenuButton alloc] init];
screenButton.translatesAutoresizingMaskIntoConstraints = NO;
[screenButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[screenButton setImage:[UIImage imageNamed:@"tabbar_discover"] forState:UIControlStateNormal];
screenButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
[screenButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
[screenButton setImage:[UIImage imageNamed:@"filter_icon"] forState:UIControlStateNormal];
screenButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
[screenButton setTitle:@"筛选" forState:UIControlStateNormal];
[sectionView addSubview:screenButton];
......
......@@ -10,13 +10,15 @@
@interface RankShopDetialCell : UITableViewCell
@property (nonatomic, strong) UILabel *addressLabel; // 地址
@property (nonatomic, strong) UILabel *dateLabel; //
//@property (nonatomic, strong) UILabel *addressLabel; // 地址
//@property (nonatomic, strong) UILabel *addressLabel; // 地址
//@property (nonatomic, strong) UILabel *addressLabel; // 地址
//@property (nonatomic, strong) UILabel *addressLabel; // 地址
//@property (nonatomic, strong) UILabel *addressLabel; // 地址
//@property (nonatomic, strong) UILabel *addressLabel; // 地址
//@property (nonatomic, strong) UILabel *addressLabel; // 地址
@property (nonatomic, strong) UILabel *titleLabel; // 总标题
@property (nonatomic, strong) UILabel *reportTimeLabel; // 上报时间
@property (nonatomic, strong) UILabel *totalScoreLabel; // 总评分
@property (nonatomic, strong) UILabel *totalGradeLabel; // 总排名
@property (nonatomic, strong) UILabel *timeLabel; // 时间
@property (nonatomic, strong) UILabel *scoreLabel; // 分数
@property (nonatomic, strong) UIView *gradeView; // 排名
@property (nonatomic, strong) UILabel *gradeLabel; // 排名
@property (nonatomic, strong) UIImageView *gradeImageView; // 排名
@property (nonatomic, strong) UIScrollView *showScrollView; // 轮播图
@end
//
// RankWorkDetailCell.h
// redstar
//
// Created by admin on 15/10/31.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RankWorkDetailCell : UITableViewCell
@property (nonatomic, strong) UILabel *workNameLabel; // 工作名称
@property (nonatomic, strong) UILabel *scoreLabel; // 分数
@property (nonatomic, strong) UILabel *gradeLabel; // 排名
@property (nonatomic, strong) UIImageView *arrowImageView; // 箭头
@end
//
// RankWorkDetailCell.m
// redstar
//
// Created by admin on 15/10/31.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankWorkDetailCell.h"
@implementation RankWorkDetailCell
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
#pragma mark - Private Methods
- (void)setup
{
self.workNameLabel.font = [UIFont systemFontOfSize:18.0];
self.arrowImageView.backgroundColor = [UIColor clearColor];
}
#pragma mark - lazy laoding
- (UILabel *)workNameLabel
{
if (!_workNameLabel) {
_workNameLabel = [[UILabel alloc] init];
_workNameLabel.translatesAutoresizingMaskIntoConstraints = NO;
_workNameLabel.textColor = kDetailBigTitleColor;
[self.contentView addSubview:_workNameLabel];
NSLayoutConstraint *workNameTop = [NSLayoutConstraint constraintWithItem:_workNameLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:workNameTop];
NSLayoutConstraint *workNameLeft = [NSLayoutConstraint constraintWithItem:_workNameLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:workNameLeft];
NSLayoutConstraint *workNameBottom = [NSLayoutConstraint constraintWithItem:_workNameLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:workNameBottom];
NSLayoutConstraint *workNameRight = [NSLayoutConstraint constraintWithItem:_workNameLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.scoreLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:-5];
[self.contentView addConstraint:workNameRight];
}
return _workNameLabel;
}
- (UILabel *)scoreLabel
{
if (!_scoreLabel) {
_scoreLabel = [[UILabel alloc] init];
_scoreLabel.translatesAutoresizingMaskIntoConstraints = NO;
_scoreLabel.textAlignment = NSTextAlignmentRight;
[self.contentView addSubview:_scoreLabel];
NSLayoutConstraint *scoreTop = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:scoreTop];
NSLayoutConstraint *scoreWidth = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:60];
[self.contentView addConstraint:scoreWidth];
NSLayoutConstraint *scoreBottom = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:scoreBottom];
NSLayoutConstraint *scoreRight = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.gradeLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:-10];
[self.contentView addConstraint:scoreRight];
}
return _scoreLabel;
}
- (UILabel *)gradeLabel
{
if (!_gradeLabel) {
_gradeLabel = [[UILabel alloc] init];
_gradeLabel.translatesAutoresizingMaskIntoConstraints = NO;
_gradeLabel.textAlignment = NSTextAlignmentRight;
[self.contentView addSubview:_gradeLabel];
NSLayoutConstraint *gradeTop = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:gradeTop];
NSLayoutConstraint *gradeWidth = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:60];
[self.contentView addConstraint:gradeWidth];
NSLayoutConstraint *gradeBottom = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:gradeBottom];
NSLayoutConstraint *gradeRight = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.arrowImageView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:-5];
[self.contentView addConstraint:gradeRight];
}
return _gradeLabel;
}
- (UIImageView *)arrowImageView
{
if (!_arrowImageView) {
_arrowImageView = [[UIImageView alloc] init];
_arrowImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_arrowImageView];
NSLayoutConstraint *arrowTop = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:18];
[self.contentView addConstraint:arrowTop];
NSLayoutConstraint *arrowRight = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:arrowRight];
NSLayoutConstraint *arrowHeight = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:14];
[self.contentView addConstraint:arrowHeight];
NSLayoutConstraint *arrowWidth = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:14];
[self.contentView addConstraint:arrowWidth];
}
return _arrowImageView;
}
@end
......@@ -9,5 +9,5 @@
#import <UIKit/UIKit.h>
@interface RankDetailViewController : UIViewController
@property (nonatomic, assign) NSInteger indexRow;
@end
......@@ -225,6 +225,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
RankDetailViewController *rankDetailVC = [[RankDetailViewController alloc] init];
rankDetailVC.indexRow = indexPath.row;
[self.navigationController pushViewController:rankDetailVC animated:YES];
}
......
......@@ -76,12 +76,13 @@
- (void)wordOfMouthClick:(UIButton *)sender
{
// InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
// [self.navigationController pushViewController:inspectListVC animated:YES];
RankingListViewController *rankListVC = [[RankingListViewController alloc] init];
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:rankListVC animated:YES];
[self.navigationController pushViewController:inspectListVC animated:YES];
// RankingListViewController *rankListVC = [[RankingListViewController alloc] init];
// self.hidesBottomBarWhenPushed = YES;
// [self.navigationController pushViewController:rankListVC animated:YES];
}
- (void)questionClick:(UIButton *)sender
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment