allVersionView.m 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // allVersionView.m
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2023/11/27.
  6. //
  7. #import "allVersionView.h"
  8. @interface allVersionView ()<UITableViewDelegate,UITableViewDataSource>
  9. @property(nonatomic,strong)UIView *whiteBgView;
  10. @property(nonatomic,strong)UITableView *tableView;
  11. @end
  12. @implementation allVersionView
  13. - (id)initWithFrame:(CGRect)frame{
  14. self = [super initWithFrame:frame];
  15. [self drawAnyView];
  16. return self;
  17. }
  18. - (void)drawAnyView{
  19. self.backgroundColor = [UIColor hwColor:@"#000000" alpha:0.6];
  20. _whiteBgView = [[UIView alloc] init];
  21. _whiteBgView.layer.cornerRadius = 8;
  22. [self addSubview:_whiteBgView];
  23. [_whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
  24. make.left.mas_equalTo(20);
  25. make.right.mas_equalTo(-20);
  26. make.height.mas_equalTo(300);
  27. make.centerY.mas_equalTo(self.center).offset(-20);
  28. }];
  29. UIButton* delBut = [[UIButton alloc] init];
  30. [delBut setImage:[UIImage imageNamed:@"common_del"] forState:UIControlStateNormal];
  31. [_whiteBgView addSubview:delBut];
  32. [delBut mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.top.mas_equalTo(0);
  34. make.right.mas_equalTo(0);
  35. make.width.mas_equalTo(40);
  36. make.height.mas_equalTo(40.0);
  37. }];
  38. //UILabel * version
  39. }
  40. #pragma mark - 懒加载
  41. - (UITableView *)tableView{
  42. if (!_tableView) {
  43. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) style:UITableViewStylePlain];
  44. _tableView.delegate = self;
  45. _tableView.dataSource = self;
  46. _tableView.showsVerticalScrollIndicator = NO;
  47. _tableView.showsHorizontalScrollIndicator = NO;
  48. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  49. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  50. [_tableView setSeparatorColor:[UIColor clearColor]];
  51. [_tableView setBackgroundColor:[UIColor clearColor]];
  52. [_tableView setTableFooterView:[UIView new]];
  53. [_tableView setBounces:YES];
  54. if (@available(iOS 15.0, *)) {
  55. _tableView.sectionHeaderTopPadding = 0;
  56. }
  57. }
  58. return _tableView;
  59. }
  60. @end