YOUPAIHRChatRoomSearchResultVC.m 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // HRChatRoomSearchVC.m
  3. // VQU
  4. //
  5. // Created by xiaohaoran on 2021/11/9.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIHRChatRoomSearchResultVC.h"
  9. #import "YOUPAIHRSearchLiveRoomCell.h"
  10. @interface YOUPAIHRChatRoomSearchResultVC ()<UITableViewDelegate,UITableViewDataSource>
  11. @property(nonatomic,strong)UITableView *youpaiptableView;
  12. @end
  13. @implementation YOUPAIHRChatRoomSearchResultVC
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. self.title = @"相关聊天室";
  17. [self youpaiptableView];
  18. }
  19. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  20. return 84;
  21. }
  22. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  23. return 10;
  24. }
  25. -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  26. YOUPAIHRSearchLiveRoomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HRSearchLiveRoomID" forIndexPath:indexPath];;
  27. if (cell == nil) {
  28. cell = [[YOUPAIHRSearchLiveRoomCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"HRSearchLiveRoomID"];
  29. }
  30. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  31. cell.backgroundColor = LCBkgColor;
  32. return cell;
  33. }
  34. -(UITableView *)youpaiptableView{
  35. if (_youpaiptableView == nil) {
  36. _youpaiptableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
  37. [self.view addSubview:_youpaiptableView];
  38. [_youpaiptableView mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.top.mas_equalTo(NavBarHeight);
  40. make.left.mas_equalTo(0);
  41. make.right.mas_equalTo(0);
  42. make.bottom.mas_equalTo(-SafeHeight);
  43. }];
  44. _youpaiptableView.delegate = self;
  45. _youpaiptableView.dataSource = self;
  46. _youpaiptableView.backgroundColor = [UIColor clearColor];
  47. _youpaiptableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  48. _youpaiptableView.showsVerticalScrollIndicator = NO;
  49. _youpaiptableView.showsHorizontalScrollIndicator = NO;
  50. if (@available(iOS 15.0, *)) {
  51. _youpaiptableView.sectionHeaderTopPadding = 0;
  52. }
  53. [_youpaiptableView registerClass:[YOUPAIHRSearchLiveRoomCell class] forCellReuseIdentifier:@"HRSearchLiveRoomID"];
  54. }
  55. return _youpaiptableView;
  56. }
  57. @end