diskListTableView.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // diskListTableView.m
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2024/1/23.
  6. //
  7. #import "diskListTableView.h"
  8. #import "diskListTableCell.h"
  9. @interface diskListTableView()<UITableViewDataSource,UITableViewDelegate>
  10. @end
  11. @implementation diskListTableView
  12. #pragma mark - init
  13. - (instancetype)init {
  14. self = [super init];
  15. if (self) {
  16. [self initCommon];
  17. }
  18. return self;
  19. }
  20. - (instancetype)initWithCoder:(NSCoder *)coder {
  21. self = [super initWithCoder:coder];
  22. if (self) {
  23. [self initCommon];
  24. }
  25. return self;
  26. }
  27. - (id)initWithFrame:(CGRect)frame {
  28. self = [super initWithFrame:frame];
  29. if (self) {
  30. [self initCommon];
  31. }
  32. return self;
  33. }
  34. - (void)initCommon {
  35. self.delegate = self;
  36. self.dataSource = self;
  37. self.separatorStyle = UITableViewCellSeparatorStyleNone;
  38. self.backgroundColor = [UIColor colorWithRed:235.0/255.0 green:235.0/255.0 blue:235.0/255.0 alpha:1.0];
  39. }
  40. #pragma mark - uitableviewDelegate
  41. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  42. static NSString *cellIdentifer = @"diskListTableCell";
  43. diskListTableCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer forIndexPath:indexPath];
  44. if(cell == nil){
  45. cell = [[diskListTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifer];
  46. }
  47. return cell;
  48. }
  49. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  50. return 1;
  51. }
  52. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  53. return 60.0;
  54. }
  55. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  56. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  57. }
  58. @end