Skip to content

Commit

Permalink
fix demo bug
Browse files Browse the repository at this point in the history
  • Loading branch information
renzifeng committed Sep 21, 2022
1 parent ee710d9 commit 60a2349
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ - (void)viewWillDisappear:(BOOL)animated {

- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
self.tableView.frame = self.view.bounds;
CGFloat y = CGRectGetMaxY(self.navigationController.navigationBar.frame);
CGFloat h = CGRectGetMaxY(self.view.frame);
self.tableView.frame = CGRectMake(0, y, self.view.frame.size.width, h-y);
}

- (void)requestData {
Expand Down Expand Up @@ -192,6 +194,11 @@ - (UITableView *)tableView {
[_tableView registerClass:[ZFTableViewCell class] forCellReuseIdentifier:kIdentifier];
_tableView.delegate = self;
_tableView.dataSource = self;
if (@available(iOS 11.0, *)) {
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
_tableView.estimatedRowHeight = 0;
_tableView.estimatedSectionFooterHeight = 0;
_tableView.estimatedSectionHeaderHeight = 0;
Expand Down

0 comments on commit 60a2349

Please sign in to comment.