BogoSetPriviteNobleViewController.m 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. //
  2. // BogoSetPriviteNobleViewController.m
  3. // BuguLive
  4. //
  5. // Created by 宋晨光 on 2021/9/26.
  6. // Copyright © 2021 xfg. All rights reserved.
  7. //
  8. #import "BogoSetPriviteNobleViewController.h"
  9. #import "SetTableViewCell.h"
  10. @interface BogoSetPriviteNobleViewController ()<UITableViewDelegate,UITableViewDataSource>
  11. @property(nonatomic, strong) UITableView *tableView;
  12. @property(nonatomic, strong) NSMutableArray *listArr;
  13. @end
  14. @implementation BogoSetPriviteNobleViewController
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. // Do any additional setup after loading the view.
  18. // self.navigationItem.title = ASLocalizedString(@"隐私特权设置");
  19. self.view.backgroundColor = [UIColor colorWithHexString:@"#F5F5F5"];
  20. UIImageView * navView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationHeight)];
  21. navView.image = [UIImage imageNamed:@"mine_navbg"];
  22. navView.userInteractionEnabled = YES;
  23. [self.view addSubview:navView];
  24. UIButton * backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  25. [backBtn setImage:[UIImage imageNamed:@"com_arrow_vc_back"] forState:UIControlStateNormal];
  26. backBtn.frame = CGRectMake(10, StatusBarHeight, 44, 44);
  27. [backBtn addTarget:self action:@selector(backLastVC) forControlEvents:UIControlEventTouchUpInside];
  28. [navView addSubview:backBtn];
  29. UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
  30. titleLabel.centerX = SCREEN_WIDTH/2;
  31. titleLabel.centerY = backBtn.centerY;
  32. titleLabel.text = ASLocalizedString(@"隐私特权设置");
  33. titleLabel.textColor = UIColor.blackColor;
  34. titleLabel.font = [UIFont boldSystemFontOfSize:18];
  35. titleLabel.textAlignment = NSTextAlignmentCenter;
  36. [navView addSubview:titleLabel];
  37. [self setupBackBtnWithBlock:nil];
  38. _listArr = [NSMutableArray arrayWithObjects:ASLocalizedString(@"隐身进场"),ASLocalizedString(@"榜单隐身"), nil];
  39. [self.view addSubview:self.tableView];
  40. }
  41. - (void)backLastVC {
  42. [self.navigationController popViewControllerAnimated:YES];
  43. }
  44. - (void)setupBackBtnWithBlock:(BackBlock)backBlock
  45. {
  46. self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(onReturnBtnPress) image:@"com_arrow_vc_back" highImage:@"com_arrow_vc_back"];
  47. }
  48. #pragma mark - UITableView Datasource
  49. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  50. return 1;
  51. }
  52. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  53. return self.listArr.count;
  54. }
  55. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  56. return kRealValue(44);
  57. }
  58. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  59. SetTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SetTableViewCell" forIndexPath:indexPath];
  60. // NSArray *sectionArr = self.listArr[indexPath.section];
  61. cell.setText.text = [NSString stringWithFormat:@"%@", self.listArr[indexPath.row]];
  62. cell.indexRow = indexPath.row;
  63. cell.setText.text = self.listArr[indexPath.row];
  64. cell.line.hidden = NO;
  65. cell.memoryText.hidden = YES;
  66. cell.nobleOpenSwitch.hidden = NO;
  67. cell.labOutLogin.hidden = YES;
  68. cell.comeBackIMG.hidden = YES;
  69. return cell;
  70. }
  71. #pragma mark - UITableView Delegate methods
  72. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  73. }
  74. -(UITableView *)tableView{
  75. if (!_tableView) {
  76. _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, NavigationHeight, kScreenW,kRealValue(44) * self.listArr.count) style:UITableViewStylePlain];
  77. _tableView.delegate = self;
  78. _tableView.dataSource = self;
  79. [_tableView registerNib:[UINib nibWithNibName:@"SetTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"SetTableViewCell"];
  80. _tableView.tableFooterView = [UIView new];
  81. _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  82. }
  83. return _tableView;
  84. }
  85. @end