RightViewController.m 3.17 KB
Newer Older
曹云霄's avatar
曹云霄 committed
1 2 3 4 5 6 7 8 9 10
//
//  RightViewController.m
//  Lighting
//
//  Created by 曹云霄 on 16/4/28.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "RightViewController.h"

曹云霄's avatar
曹云霄 committed
11 12 13 14
@interface RightViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic,strong) UITableView *rightTableview;
@property (nonatomic,strong) NSArray *dataArray;
曹云霄's avatar
曹云霄 committed
15 16 17 18 19

@end

@implementation RightViewController

曹云霄's avatar
曹云霄 committed
20 21 22 23 24 25 26 27 28
/**
 *  初始化数据源
 *
 *  @return NSArray
 */
- (NSArray *)dataArray
{
    if (_dataArray == nil) {
        
zhu's avatar
zhu committed
29
        _dataArray = [NSArray arrayWithObjects:@"随心配",@"场景库",@"产品库",@"体验中心",@"客户管理",@"关于", nil];
曹云霄's avatar
曹云霄 committed
30 31 32 33
    }
    return _dataArray;
}

曹云霄's avatar
曹云霄 committed
34 35 36 37
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
曹云霄's avatar
曹云霄 committed
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
    [self uiConfigAction];
}

#pragma mark -布局
- (void)uiConfigAction
{
    self.rightTableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, RightWidth, ScreenHeight) style:UITableViewStylePlain];
    self.rightTableview.delegate = self;
    self.rightTableview.dataSource = self;
    [self.view addSubview:self.rightTableview];
    self.rightTableview.tableFooterView = [UIView new];
    [self.rightTableview registerClass:[UITableViewCell class] forCellReuseIdentifier:@"rightcell"];
    [self createHeaderview];
}

#pragma mark -头部视图
- (void)createHeaderview
{
    UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, RightWidth, 200)];
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 80, 80)];
    imageView.center = CGPointMake(RightWidth/2, 100);
    imageView.image = TCImage(@"weibo");
    [headerView addSubview:imageView];
    self.rightTableview.tableHeaderView = headerView;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"rightcell" forIndexPath:indexPath];
    cell.textLabel.text = [self.dataArray objectAtIndex_opple:indexPath.row];
    
    return  cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.dataArray.count;
}
曹云霄's avatar
曹云霄 committed
76

曹云霄's avatar
曹云霄 committed
77 78
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
zhu's avatar
zhu committed
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
    switch (indexPath.row) {
        case 0:  //随心配
            
            break;
        case 1:  //场景库
            
            break;

        case 2:  //产品库
            
            break;
        case 3: //体验中心
            
            break;
        case 4: //客户管理
            
            break;

        case 5://关于
            
            break;

            
        default:
            break;
    }
曹云霄's avatar
曹云霄 committed
105 106
}

曹云霄's avatar
曹云霄 committed
107 108


曹云霄's avatar
曹云霄 committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#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