PicSymbol.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //
  2. // PicSymbol.m
  3. // jiaPei
  4. //
  5. // Created by apple on 16/1/4.
  6. // Copyright © 2016年 JCZ. All rights reserved.
  7. //PicSymbol.h
  8. #import "PicSymbol.h"
  9. #import "PicSymbolTableViewCell.h"
  10. #import "symbol.h"
  11. #import "ChildSymbolVC.h"
  12. @interface PicSymbol ()<UITableViewDataSource,UITableViewDelegate>
  13. {
  14. NSArray *titleArray;
  15. NSArray *countArray;
  16. }
  17. @end
  18. @implementation PicSymbol
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. self.title = @"交通标志大全";
  22. self.view.backgroundColor = backGroundColor;
  23. [self configNavigationBar];
  24. titleArray = @[@"交通标志",@"汽车仪表盘指示灯",@"新版交警手势",@"车内功能按键",@"交通事故责任认定图解",@"色盲测试图集"];
  25. countArray = @[@"389",@"21",@"8",@"6",@"35",@"19"];
  26. UITableView *mainTabView = [[UITableView alloc] initWithFrame:kFrame style:UITableViewStylePlain];
  27. mainTabView.height -= kNavOffSet;
  28. mainTabView.delegate = self;
  29. mainTabView.dataSource = self;
  30. mainTabView.rowHeight = kFrame.size.width/5.0 + 30;
  31. mainTabView.tableFooterView = [UIView new];
  32. [self.view addSubview:mainTabView];
  33. [mainTabView registerClass:[PicSymbolTableViewCell class] forCellReuseIdentifier:@"cell"];
  34. }
  35. #pragma mark tableView delegate
  36. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  37. {
  38. return titleArray.count;
  39. }
  40. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  41. {
  42. PicSymbolTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
  43. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  44. cell.titleLable.text = titleArray[indexPath.row];
  45. if (indexPath.row == 0)
  46. {
  47. cell.img1.image = [UIImage imageNamed:@"1-1-1.jpg"];
  48. cell.img2.image = [UIImage imageNamed:@"1-1-2.jpg"];
  49. cell.img3.image = [UIImage imageNamed:@"1-1-3.jpg"];
  50. cell.img4.image = [UIImage imageNamed:@"1-1-4.jpg"];
  51. }
  52. else
  53. {
  54. cell.img1.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d-1%d-1.jpg",(int)indexPath.row + 1,(int)indexPath.row + 1]];
  55. cell.img2.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d-1%d-2.jpg",(int)indexPath.row + 1,(int)indexPath.row + 1]];
  56. cell.img3.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d-1%d-3.jpg",(int)indexPath.row + 1,(int)indexPath.row + 1]];
  57. cell.img4.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d-1%d-4.jpg",(int)indexPath.row + 1,(int)indexPath.row + 1]];
  58. }
  59. cell.countLabel.text = countArray[indexPath.row];
  60. return cell;
  61. }
  62. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  63. {
  64. if (indexPath.row == 0)
  65. {
  66. symbol *sym = [[symbol alloc] init];
  67. [self navPushHideTabbarToVC:sym];
  68. }
  69. else
  70. {
  71. ChildSymbolVC *childSym = [[ChildSymbolVC alloc] init];
  72. childSym.rowTag = indexPath.row + 10;
  73. childSym.MI_GROUP = [NSString stringWithFormat:@"%d",(int)indexPath.row + 1];
  74. childSym.MI_TYPE = [NSString stringWithFormat:@"1%d",(int)indexPath.row + 1];
  75. [self navPushHideTabbarToVC:childSym];
  76. }
  77. }
  78. - (void)didReceiveMemoryWarning {
  79. [super didReceiveMemoryWarning];
  80. // Dispose of any resources that can be recreated.
  81. }
  82. /*
  83. #pragma mark - Navigation
  84. // In a storyboard-based application, you will often want to do a little preparation before navigation
  85. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  86. // Get the new view controller using [segue destinationViewController].
  87. // Pass the selected object to the new view controller.
  88. }
  89. */
  90. @end