137 lines
3.4 KiB
Objective-C
137 lines
3.4 KiB
Objective-C
//
|
|
// WoDeKanKanViewController.m
|
|
// Ifish
|
|
//
|
|
// Created by imac on 16/11/9.
|
|
// Copyright © 2016年 lianxiang. All rights reserved.
|
|
//
|
|
|
|
#import "WoDeKanKanViewController.h"
|
|
#import "WoDeKanKanViewCell.h"
|
|
#import "MineKankanEditViewController.h"
|
|
@interface WoDeKanKanViewController ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
|
@property(nonatomic,strong)UITableView *tableView;
|
|
|
|
@property(nonatomic,strong) NSMutableArray *dataArr;
|
|
|
|
|
|
@end
|
|
|
|
@implementation WoDeKanKanViewController
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
//
|
|
[self addTitleViewWithTitle:@"我的看看"];
|
|
[self creatTab];
|
|
|
|
}
|
|
|
|
-(void)creatTab{
|
|
|
|
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height ) style:UITableViewStylePlain];
|
|
|
|
self.tableView.delegate = self;
|
|
self.tableView.dataSource = self;
|
|
self.tableView.scrollEnabled = YES;
|
|
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
|
self.tableView.showsVerticalScrollIndicator = NO;
|
|
self.tableView.backgroundColor = TABLE_BACKGROUD_COLOR;
|
|
[self.view addSubview:self.tableView];
|
|
|
|
|
|
}
|
|
|
|
#pragma mark - Table view data source
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
|
|
return 20;
|
|
}
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
WoDeKanKanViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WoDeKanKanViewCell"];
|
|
if (!cell) {
|
|
|
|
cell = [[[NSBundle mainBundle]loadNibNamed:@"WoDeKanKanViewCell" owner:self options:nil]lastObject];
|
|
|
|
}
|
|
|
|
[cell.editBtn addTarget:self action:@selector(editBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
|
|
|
if (section == 0) {
|
|
return 0;
|
|
|
|
}else{
|
|
return 20;
|
|
|
|
}
|
|
}
|
|
|
|
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
|
{
|
|
return kScreenSize.width*0.65;
|
|
|
|
}
|
|
|
|
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
|
UIView*view = nil;
|
|
|
|
if (section!=0) {
|
|
|
|
view= [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenSize.width, 20)];
|
|
view.backgroundColor = RGB(242, 242, 242);
|
|
|
|
}
|
|
|
|
return view;
|
|
|
|
}
|
|
|
|
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
|
|
|
|
|
}
|
|
|
|
- (void)didReceiveMemoryWarning {
|
|
[super didReceiveMemoryWarning];
|
|
// Dispose of any resources that can be recreated.
|
|
}
|
|
|
|
|
|
-(void)editBtnAction{
|
|
|
|
|
|
MineKankanEditViewController *editVC = [[MineKankanEditViewController alloc] init];
|
|
|
|
[self.navigationController pushViewController:editVC animated:YES];
|
|
|
|
}
|
|
|
|
/*
|
|
#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
|