123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- //
- // PicSymbol.m
- // jiaPei
- //
- // Created by apple on 16/1/4.
- // Copyright © 2016年 JCZ. All rights reserved.
- //PicSymbol.h
- #import "PicSymbol.h"
- #import "PicSymbolTableViewCell.h"
- #import "symbol.h"
- #import "ChildSymbolVC.h"
- @interface PicSymbol ()<UITableViewDataSource,UITableViewDelegate>
- {
- NSArray *titleArray;
- NSArray *countArray;
- }
- @end
- @implementation PicSymbol
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.title = @"交通标志大全";
- self.view.backgroundColor = backGroundColor;
- [self configNavigationBar];
-
- titleArray = @[@"交通标志",@"汽车仪表盘指示灯",@"新版交警手势",@"车内功能按键",@"交通事故责任认定图解",@"色盲测试图集"];
- countArray = @[@"389",@"21",@"8",@"6",@"35",@"19"];
-
- UITableView *mainTabView = [[UITableView alloc] initWithFrame:kFrame style:UITableViewStylePlain];
- mainTabView.height -= kNavOffSet;
- mainTabView.delegate = self;
- mainTabView.dataSource = self;
- mainTabView.rowHeight = kFrame.size.width/5.0 + 30;
- mainTabView.tableFooterView = [UIView new];
- [self.view addSubview:mainTabView];
-
- [mainTabView registerClass:[PicSymbolTableViewCell class] forCellReuseIdentifier:@"cell"];
- }
- #pragma mark tableView delegate
- -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return titleArray.count;
- }
- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- PicSymbolTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
-
- [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
-
- cell.titleLable.text = titleArray[indexPath.row];
- if (indexPath.row == 0)
- {
- cell.img1.image = [UIImage imageNamed:@"1-1-1.jpg"];
- cell.img2.image = [UIImage imageNamed:@"1-1-2.jpg"];
- cell.img3.image = [UIImage imageNamed:@"1-1-3.jpg"];
- cell.img4.image = [UIImage imageNamed:@"1-1-4.jpg"];
- }
- else
- {
- cell.img1.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d-1%d-1.jpg",(int)indexPath.row + 1,(int)indexPath.row + 1]];
- cell.img2.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d-1%d-2.jpg",(int)indexPath.row + 1,(int)indexPath.row + 1]];
- cell.img3.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d-1%d-3.jpg",(int)indexPath.row + 1,(int)indexPath.row + 1]];
- cell.img4.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d-1%d-4.jpg",(int)indexPath.row + 1,(int)indexPath.row + 1]];
- }
-
- cell.countLabel.text = countArray[indexPath.row];
-
- return cell;
- }
- -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- if (indexPath.row == 0)
- {
- symbol *sym = [[symbol alloc] init];
- [self navPushHideTabbarToVC:sym];
- }
- else
- {
- ChildSymbolVC *childSym = [[ChildSymbolVC alloc] init];
- childSym.rowTag = indexPath.row + 10;
- childSym.MI_GROUP = [NSString stringWithFormat:@"%d",(int)indexPath.row + 1];
- childSym.MI_TYPE = [NSString stringWithFormat:@"1%d",(int)indexPath.row + 1];
- [self navPushHideTabbarToVC:childSym];
- }
- }
- - (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
|