AccompanyDetailViewController.m 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // AccompanyDetailViewController.m
  3. // KulexiuForTeacher
  4. //
  5. // Created by 王智 on 2022/4/6.
  6. //
  7. #import "AccompanyDetailViewController.h"
  8. #import "AccompanyNavView.h"
  9. @interface AccompanyDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
  10. @property (nonatomic, strong) AccompanyNavView *navView;
  11. @property (nonatomic, strong) UITableView *tableView;
  12. @end
  13. @implementation AccompanyDetailViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view.
  17. self.ks_prefersNavigationBarHidden = YES;
  18. [self configUI];
  19. }
  20. - (void)configUI {
  21. [self.scrollView removeFromSuperview];
  22. [self.view addSubview:self.navView];
  23. CGFloat height = [self.navView getViewHeight];
  24. [self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
  25. make.left.right.top.mas_equalTo(self);
  26. make.height.mas_equalTo(height);
  27. }];
  28. }
  29. #pragma mark --- lazying
  30. - (UITableView *)tableView {
  31. if (!_tableView) {
  32. _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  33. _tableView.delegate = self;
  34. _tableView.dataSource = self;
  35. _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  36. _tableView.showsVerticalScrollIndicator = NO;
  37. _tableView.backgroundColor = [UIColor clearColor];
  38. _tableView.rowHeight = UITableViewAutomaticDimension;
  39. _tableView.estimatedRowHeight = 136.0f;
  40. UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)];
  41. bottomView.backgroundColor = [UIColor clearColor];
  42. _tableView.tableFooterView = bottomView;
  43. }
  44. return _tableView;
  45. }
  46. - (AccompanyNavView *)navView {
  47. if (!_navView) {
  48. _navView = [AccompanyNavView shareInstance];
  49. MJWeakSelf;
  50. [_navView navCallback:^{
  51. [weakSelf backAction];
  52. }];
  53. }
  54. return _navView;
  55. }
  56. /*
  57. #pragma mark - Navigation
  58. // In a storyboard-based application, you will often want to do a little preparation before navigation
  59. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  60. // Get the new view controller using [segue destinationViewController].
  61. // Pass the selected object to the new view controller.
  62. }
  63. */
  64. @end