symbol.m 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //
  2. // symbol.m
  3. // jiaPei
  4. //
  5. // Created by apple on 16/1/5.
  6. // Copyright © 2016年 JCZ. All rights reserved.
  7. //
  8. #import "symbol.h"
  9. #import "symbolCell.h"
  10. #import "ChildSymbolVC.h"
  11. @interface symbol ()<UITableViewDataSource,UITableViewDelegate>
  12. {
  13. NSArray *titleArray;
  14. NSArray *countArray;
  15. }
  16. @end
  17. @implementation symbol
  18. - (void)viewDidLoad {
  19. [super viewDidLoad];
  20. //这是交通类型子类型页面
  21. self.title = @"交通标志";
  22. [self configNavigationBar];
  23. titleArray = @[@"禁令标志",@"警告标志",@"指示标志",@"指路标志",@"道路施工安全标志",@"旅游区标志",@"辅助标志",@"禁止标线",@"警告标线",@"指示标线",@"道路安全设施设置"];
  24. countArray = @[@"42",@"48",@"29",@"126",@"26",@"17",@"16",@"24",@"13",@"33",@"15"];
  25. UITableView *mainTableView = [[UITableView alloc] initWithFrame:kFrame style:UITableViewStylePlain];
  26. mainTableView.height -= kNavOffSet;
  27. mainTableView.delegate = self;
  28. mainTableView.dataSource = self;
  29. mainTableView.rowHeight = SGFloat(50);
  30. [self.view addSubview:mainTableView];
  31. mainTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
  32. [mainTableView registerClass:[symbolCell class] forCellReuseIdentifier:@"cell"];
  33. }
  34. #pragma mark tableView delegate
  35. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  36. {
  37. return titleArray.count;
  38. }
  39. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  40. {
  41. symbolCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
  42. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  43. [cell.image setImage:[UIImage imageNamed:[NSString stringWithFormat:@"1-%d-1.jpg",(int)indexPath.row + 1]]];
  44. cell.titleLabel.text = titleArray[indexPath.row];
  45. cell.countLabel.text = countArray[indexPath.row];
  46. [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
  47. return cell;
  48. }
  49. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  50. {
  51. ChildSymbolVC *childSym = [[ChildSymbolVC alloc] init];
  52. childSym.rowTag = indexPath.row;
  53. childSym.MI_GROUP = @"1";
  54. childSym.MI_TYPE = [NSString stringWithFormat:@"%d",(int)indexPath.row + 1];
  55. [self navPushHideTabbarToVC:childSym];
  56. }
  57. - (void)didReceiveMemoryWarning {
  58. [super didReceiveMemoryWarning];
  59. // Dispose of any resources that can be recreated.
  60. }
  61. /*
  62. #pragma mark - Navigation
  63. // In a storyboard-based application, you will often want to do a little preparation before navigation
  64. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  65. // Get the new view controller using [segue destinationViewController].
  66. // Pass the selected object to the new view controller.
  67. }
  68. */
  69. @end