OtherRoomViewController.m 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // OtherRoomViewController.m
  3. // yunbaolive
  4. //
  5. // Created by IOS1 on 2019/4/26.
  6. // Copyright © 2019 cat. All rights reserved.
  7. //
  8. #import "OtherRoomViewController.h"
  9. #import "RoomUserTypeCell.h"
  10. #import "RoomUserListViewController.h"
  11. @interface OtherRoomViewController ()<UITableViewDelegate,UITableViewDataSource>{
  12. UITableView *leftTable;
  13. NSArray *listArray;
  14. }
  15. @end
  16. @implementation OtherRoomViewController
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. self.titleL.text = _titleStr;
  20. listArray = @[YZMsg(@"禁言列表"),YZMsg(@"踢人列表")];
  21. leftTable = [[UITableView alloc]initWithFrame:CGRectMake(0, 64+statusbarHeight, _window_width, _window_height-64-statusbarHeight-ShowDiff) style:0];
  22. leftTable.delegate = self;
  23. leftTable.dataSource = self;
  24. leftTable.separatorStyle = 0;
  25. leftTable.backgroundColor = Normal_Color;
  26. [self.view addSubview:leftTable];
  27. }
  28. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  29. return listArray.count;
  30. }
  31. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  32. RoomUserTypeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RoomUserTypeCELL"];
  33. if (!cell) {
  34. cell = [[[NSBundle mainBundle] loadNibNamed:@"RoomUserTypeCell" owner:nil options:nil] lastObject];
  35. }
  36. cell.titleL.text = listArray[indexPath.row];
  37. cell.backgroundColor = CellRow_Cor;
  38. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  39. return cell;
  40. }
  41. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  42. RoomUserListViewController *vc = [[RoomUserListViewController alloc]init];
  43. vc.type = indexPath.row+1;
  44. vc.titleStr = listArray[indexPath.row];
  45. vc.liveuid = _liveuid;
  46. [self.navigationController pushViewController:vc animated:YES];
  47. }
  48. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  49. return 50.0;
  50. }
  51. /*
  52. #pragma mark - Navigation
  53. // In a storyboard-based application, you will often want to do a little preparation before navigation
  54. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  55. // Get the new view controller using [segue destinationViewController].
  56. // Pass the selected object to the new view controller.
  57. }
  58. */
  59. @end