symbol.m 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.view.backgroundColor = backGroundColor;
  23. [self configNavigationBar];
  24. titleArray = @[@"禁令标志",@"警告标志",@"指示标志",@"指路标志",@"道路施工安全标志",@"旅游区标志",@"辅助标志",@"禁止标线",@"警告标线",@"指示标线",@"道路安全设施设置"];
  25. countArray = @[@"42",@"48",@"29",@"126",@"26",@"17",@"16",@"24",@"13",@"33",@"15"];
  26. UITableView *mainTableView = [[UITableView alloc] initWithFrame:kFrame style:UITableViewStylePlain];
  27. mainTableView.height -= kNavOffSet;
  28. mainTableView.delegate = self;
  29. mainTableView.dataSource = self;
  30. mainTableView.rowHeight = SGFloat(50);
  31. [self.view addSubview:mainTableView];
  32. mainTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
  33. [mainTableView registerClass:[symbolCell 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. symbolCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
  43. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  44. [cell.image setImage:[UIImage imageNamed:[NSString stringWithFormat:@"1-%d-1.jpg",(int)indexPath.row + 1]]];
  45. cell.titleLabel.text = titleArray[indexPath.row];
  46. cell.countLabel.text = countArray[indexPath.row];
  47. [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
  48. return cell;
  49. }
  50. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  51. {
  52. ChildSymbolVC *childSym = [[ChildSymbolVC alloc] init];
  53. childSym.rowTag = indexPath.row;
  54. childSym.MI_GROUP = @"1";
  55. childSym.MI_TYPE = [NSString stringWithFormat:@"%d",(int)indexPath.row + 1];
  56. [self navPushHideTabbarToVC:childSym];
  57. }
  58. - (void)didReceiveMemoryWarning {
  59. [super didReceiveMemoryWarning];
  60. // Dispose of any resources that can be recreated.
  61. }
  62. /*
  63. #pragma mark - Navigation
  64. // In a storyboard-based application, you will often want to do a little preparation before navigation
  65. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  66. // Get the new view controller using [segue destinationViewController].
  67. // Pass the selected object to the new view controller.
  68. }
  69. */
  70. @end