Commit 7b25932f authored by admin's avatar admin

完成问题与知识列表 图说口碑列表布局

parent cff96300
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "textbox@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "textbox@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "commend@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "commend@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "commend_after@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "commend_after@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "comment@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "comment@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "comment_after@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "comment_after@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -82,6 +82,31 @@ ...@@ -82,6 +82,31 @@
#define kProgressViewAllBackColor [UIColor colorWithRed:244 / 255.0 green:244 / 255.0 blue:244 / 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] #define kProgressViewAlreadyBackColor [UIColor colorWithRed:112 / 255.0 green:120 / 255.0 blue:216 / 255.0 alpha:1.0]
// OnLine
// #444444
#define kOnLineCellTitleColor [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
// #bbbbbb
#define kOnLineCellDetailColor [UIColor colorWithRed:187 / 255.0 green:187 / 255.0 blue:187 / 255.0 alpha:1.0]
// #f6f6f6
#define kFootViewBackGroundColor [UIColor colorWithRed:246 / 255.0 green:246 / 255.0 blue:246 / 255.0 alpha:1.0]
// Picture
#define kPictureCellTitleColor [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
#define kPictureCellDetailsColor [UIColor colorWithRed:83 / 255.0 green:83 / 255.0 blue:83 / 255.0 alpha:1.0]
#define kPictureCellDateColor [UIColor colorWithRed:135 / 255.0 green:135 / 255.0 blue:135 / 255.0 alpha:1.0]
// Question
// #444444
#define kQuestionCellTitleColor [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
// #fe6903
#define kHotBackGroundColor [UIColor colorWithRed:254 / 255.0 green:105 / 255.0 blue:3 / 255.0 alpha:1.0]
// #999999
#define kQuestionStateColor [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1.0]
#import "UIView+Extension.h" #import "UIView+Extension.h"
......
//
// OnLineTableViewCell.h
// redstar
//
// Created by admin on 15/11/1.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineTableViewCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *selectLabel;
@end
//
// OnLineTableViewCell.m
// redstar
//
// Created by admin on 15/11/1.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "OnLineTableViewCell.h"
@implementation OnLineTableViewCell
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
#pragma mark - Private Methods
- (void)setup
{
self.titleLabel.textColor = kOnLineCellTitleColor;
self.selectLabel.textColor = kOnLineCellDetailColor;
}
#pragma mark - lazy loading
- (UILabel *)titleLabel
{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
_titleLabel.font = [UIFont systemFontOfSize:16.0];
[self.contentView addSubview:_titleLabel];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:titleLeft];
// 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.selectLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:titleRight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:titleBottom];
}
return _titleLabel;
}
#pragma mark - lazy loading
- (UILabel *)selectLabel
{
if (!_selectLabel) {
_selectLabel = [[UILabel alloc] init];
_selectLabel.textAlignment = NSTextAlignmentRight;
_selectLabel.text = @"请选择";
_selectLabel.translatesAutoresizingMaskIntoConstraints = NO;
_selectLabel.font = [UIFont systemFontOfSize:15.0];
[self.contentView addSubview:_selectLabel];
// 顶端
NSLayoutConstraint *selectTop = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:selectTop];
// 左边
NSLayoutConstraint *selectRight = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:selectRight];
// 右边
NSLayoutConstraint *selectWidth = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50];
[self.contentView addConstraint:selectWidth];
// 高度
NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:selectBottom];
}
return _selectLabel;
}
@end
//
// OnLineFooterView.h
// redstar
//
// Created by admin on 15/11/1.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineFooterView : UIView
@property (nonatomic, strong) UITextView *titleTextView;
@property (nonatomic, strong) UITextView *contentTextView;
@property (nonatomic, strong) UIButton *saveButton;
@end
This diff is collapsed.
//
// OnLineViewController.h
// redstar
//
// Created by admin on 15/11/1.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineViewController : UIViewController
@end
//
// OnLineViewController.m
// redstar
//
// Created by admin on 15/11/1.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "OnLineViewController.h"
#import "OnLineTableViewCell.h"
#import "OnLineFooterView.h"
#define kOnLineTableViewCell @"onlineTableViewCell"
@interface OnLineViewController () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) OnLineFooterView *footView;
@end
@implementation OnLineViewController
- (void)viewDidLoad
{
[super viewDidLoad];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"发起抽查任务"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
self.titleArray = [NSArray arrayWithObjects:@"商场名称", @"截止时间", nil];
[self addTableView];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Private Methods
- (void)addTableView
{
[self.tableView registerClass:[OnLineTableViewCell class] forCellReuseIdentifier:kOnLineTableViewCell];
self.tableView.tableFooterView = self.footView;
}
- (void)saveClick:(UIButton *)sender
{
NSLog(@"保存并下达");
}
#pragma mark - TableView Delegate/DateSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _titleArray.count;
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
OnLineTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kOnLineTableViewCell];
if (!cell) {
cell = [[OnLineTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineTableViewCell];
}
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _titleArray[indexPath.row]];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
// cell的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 50;
}
#pragma mark - lazy loading
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:tableLeft];
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom];
}
return _tableView;
}
- (OnLineFooterView *)footView
{
if (!_footView) {
if (kScreenHeight == 480) {
_footView = [[OnLineFooterView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 400)];
} else {
_footView = [[OnLineFooterView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, (kScreenHeight - 100 - 63))];
}
[_footView.saveButton addTarget:self action:@selector(saveClick:) forControlEvents:UIControlEventTouchUpInside];
}
return _footView;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// PictureTableCell.h
// redstar
//
// Created by admin on 15/11/1.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ZanButton.h"
@interface PictureTableCell : UITableViewCell
@property (nonatomic, strong) UIImageView *titleImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *detailsLabel;
@property (nonatomic, strong) UILabel *dateLabel;
@property (nonatomic, strong) ZanButton *thumbBtn;
@property (nonatomic, strong) ZanButton *commentBtn;
@end
//
// PictureViewController.h
// redstar
//
// Created by admin on 15/11/1.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PictureViewController : UIViewController
@end
//
// QuestionListTableCell.h
// redstar
//
// Created by admin on 15/11/2.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ZanButton.h"
@interface QuestionListTableCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; // 标题
@property (nonatomic, strong) UILabel *hotLabel; // hot
@property (nonatomic, strong) UILabel *detailsLabel; // 副标题
@property (nonatomic, strong) UILabel *stateLabel; // 分类
@property (nonatomic, strong) UILabel *dateLabel; // 时间
@property (nonatomic, strong) ZanButton *thumbBtn; // 点赞
@end
//
// QuestionViewController.h
// redstar
//
// Created by admin on 15/11/2.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface QuestionViewController : UIViewController
@end
//
// QuestionViewController.m
// redstar
//
// Created by admin on 15/11/2.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "QuestionViewController.h"
#import "QuestionListTableCell.h"
#import "MenuButton.h"
#define kQuestionListCell @"questionListTableViewCell"
@interface QuestionViewController () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@end
@implementation QuestionViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self.tableView registerClass:[QuestionListTableCell class] forCellReuseIdentifier:kQuestionListCell];
[self setupNav];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Private Methods
#pragma mark - Private Methods
- (void)setupNav
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"问题与知识"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *rightButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 20)];
[rightButton setTitle:@"新增问题" forState:UIControlStateNormal];
[rightButton addTarget:self action:@selector(addClick:) forControlEvents:UIControlEventTouchUpInside];
[rightButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
rightButton.titleLabel.font = [UIFont systemFontOfSize:15];
UIBarButtonItem *rightButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightButton];
self.navigationItem.rightBarButtonItem = rightButtonItem;
}
- (void)addClick:(UIButton *)sender
{
}
#pragma mark - UItableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 5;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
QuestionListTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kQuestionListCell];
if (!cell) {
cell = [[QuestionListTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kQuestionListCell];
}
cell.titleLabel.text = @"系统跟单维护回访短信早于物流跟单送货";
cell.detailsLabel.text = @"新的SOP营业员跟单送货完成后的两天内未能及时返回,回访短信已经发送";
cell.stateLabel.text = @"服务 - 15分钟退单";
cell.dateLabel.text = @"提报时间:2015-09-10 08:10:18";
return cell;
}
// cell的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 120;
}
// section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 45;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 0;
}
// 自定义section
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
// 创建sectionView
UIView *sectionView = [[UIView alloc] init];
sectionView.userInteractionEnabled = YES;
sectionView.backgroundColor = kInspectSectionBackGroundColor;
UIView *lineView = [[UIView alloc] init];
lineView.translatesAutoresizingMaskIntoConstraints = NO;
lineView.backgroundColor = kSeparateLineColor;
[sectionView addSubview:lineView];
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];
[sectionView addConstraint:lineLeft];
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:0];
[sectionView addConstraint:lineBottom];
MenuButton *taxiButton = [[MenuButton alloc] init];
taxiButton.translatesAutoresizingMaskIntoConstraints = NO;
[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: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];
// taxiButton布局
NSLayoutConstraint *taxiButtonTop = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[sectionView addConstraint:taxiButtonTop];
NSLayoutConstraint *taxiButtonLeft = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[sectionView addConstraint:taxiButtonLeft];
NSLayoutConstraint *taxiButtonWidth = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:screenButton attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[sectionView addConstraint:taxiButtonWidth];
NSLayoutConstraint *taxiButtonBottom = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[sectionView addConstraint:taxiButtonBottom];
// screenButton布局
NSLayoutConstraint *screenButtonTop = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[sectionView addConstraint:screenButtonTop];
NSLayoutConstraint *screenButtonRight = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[sectionView addConstraint:screenButtonRight];
NSLayoutConstraint *screenButtonLeft = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:taxiButton attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[sectionView addConstraint:screenButtonLeft];
NSLayoutConstraint *screenButtonBottom = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[sectionView addConstraint:screenButtonBottom];
return sectionView;
}
#pragma mark - lazy loading
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:tableLeft];
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom];
}
return _tableView;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
#import "InspectListViewController.h" #import "InspectListViewController.h"
#import "RankingListViewController.h" #import "RankingListViewController.h"
#import "OnLineViewController.h"
#import "PictureViewController.h"
#import "QuestionViewController.h"
#define kNewAnnounceCell @"NewAnnounceTableViewCell" #define kNewAnnounceCell @"NewAnnounceTableViewCell"
#define kHomeFunctionCell @"HomeFunctionCell" #define kHomeFunctionCell @"HomeFunctionCell"
...@@ -69,11 +72,15 @@ ...@@ -69,11 +72,15 @@
NSLog(@"查看全部公告···"); NSLog(@"查看全部公告···");
} }
// 在线抽查或任务处理
- (void)onLineSamplingClick:(UIButton *)sender - (void)onLineSamplingClick:(UIButton *)sender
{ {
OnLineViewController *onLineVC = [[OnLineViewController alloc] init];
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:onLineVC animated:YES];
} }
// 口碑列表 或口碑排名
- (void)wordOfMouthClick:(UIButton *)sender - (void)wordOfMouthClick:(UIButton *)sender
{ {
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init]; InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
...@@ -85,9 +92,12 @@ ...@@ -85,9 +92,12 @@
// [self.navigationController pushViewController:rankListVC animated:YES]; // [self.navigationController pushViewController:rankListVC animated:YES];
} }
// 问题与知识
- (void)questionClick:(UIButton *)sender - (void)questionClick:(UIButton *)sender
{ {
QuestionViewController *questionVC = [[QuestionViewController alloc] init];
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:questionVC animated:YES];
} }
- (void)standardClick:(UIButton *)sender - (void)standardClick:(UIButton *)sender
...@@ -95,9 +105,12 @@ ...@@ -95,9 +105,12 @@
} }
// 图说口碑
- (void)pictureClick:(UIButton *)sender - (void)pictureClick:(UIButton *)sender
{ {
PictureViewController *pictureVC = [[PictureViewController alloc] init];
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:pictureVC animated:YES];
} }
- (void)caseClick:(UIButton *)sender - (void)caseClick:(UIButton *)sender
......
//
// ZanButton.h
// redstar
//
// Created by admin on 15/11/2.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ZanButton : UIButton
@end
//
// ZanButton.m
// redstar
//
// Created by admin on 15/11/2.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "ZanButton.h"
@implementation ZanButton
// 修改按钮内部子控件的frame
- (void)layoutSubviews
{
[super layoutSubviews];
// 1.imageView
CGFloat imageX = 5;
CGFloat imageY = 0;
CGFloat imageW = 17;
CGFloat imageH = 18;
self.imageView.frame = CGRectMake(imageX, imageY, imageW, imageH);
// 2.title
CGFloat titleX = self.bounds.size.width / 2;
CGFloat titleY = 1;
CGFloat titleW = self.bounds.size.width / 2;
CGFloat titleH = self.bounds.size.height - titleY;
self.titleLabel.frame = CGRectMake(titleX, titleY, titleW, titleH);
}
@end
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