修改了房间排行显示异常的问题

This commit is contained in:
fengshuo
2022-10-31 15:29:11 +08:00
parent 036e5a9352
commit 3fc82a7165
2 changed files with 15 additions and 5 deletions

View File

@@ -58,7 +58,6 @@
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[self.rankButton mas_makeConstraints:^(MASConstraintMaker *make) { [self.rankButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(25 * 1.2, 21 * 1.2));
make.left.mas_equalTo(self.contentView).offset(15); make.left.mas_equalTo(self.contentView).offset(15);
make.centerY.mas_equalTo(self.contentView); make.centerY.mas_equalTo(self.contentView);
}]; }];
@@ -122,6 +121,7 @@
_rankButton = [UIButton buttonWithType:UIButtonTypeCustom]; _rankButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_rankButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.3] forState:UIControlStateNormal]; [_rankButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.3] forState:UIControlStateNormal];
_rankButton.titleLabel.font = [UIFont systemFontOfSize:24 weight:UIFontWeightBold]; _rankButton.titleLabel.font = [UIFont systemFontOfSize:24 weight:UIFontWeightBold];
[_rankButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
} }
return _rankButton; return _rankButton;
} }

View File

@@ -68,8 +68,17 @@
[self.view addSubview:self.myInfoView]; [self.view addSubview:self.myInfoView];
[self.contentImageView addSubview:self.tableView]; [self.contentImageView addSubview:self.tableView];
CGFloat scale = 283.0 / 375.0;
CGFloat kOffY = (scale * KScreenWidth + 8 + 40 + 16 + 443) - KScreenHeight;
CGFloat kbottomHeight = ( 64 + kSafeAreaBottomHeight);
if (kOffY > 0) {
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, kbottomHeight+ kOffY + 10, 0);
} else if(fabs(kOffY) > kbottomHeight) {
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, fabs(kOffY) - kbottomHeight + 10, 0);
} else {
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, kbottomHeight + 10, 0);
}
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 64 + kSafeAreaBottomHeight, 0);
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
@@ -79,10 +88,11 @@
make.top.mas_equalTo(self.view).offset(kStatusBarHeight); make.top.mas_equalTo(self.view).offset(kStatusBarHeight);
}]; }];
CGFloat scale = 283.0 / 375.0; CGFloat scale = 283.0 / 375.0;
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self.view); make.left.right.mas_equalTo(self.view);
make.height.mas_equalTo(KScreenWidth * scale); make.height.mas_equalTo(KScreenWidth * scale);
make.top.mas_equalTo(self.view.mas_top);
}]; }];
[self.updateView mas_makeConstraints:^(MASConstraintMaker *make) { [self.updateView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -101,7 +111,7 @@
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.contentImageView).offset(10); make.top.mas_equalTo(self.contentImageView).offset(10);
make.left.right.mas_equalTo(self.contentImageView); make.left.right.mas_equalTo(self.contentImageView);
make.bottom.mas_equalTo(self.contentImageView).offset(-88); make.bottom.mas_equalTo(self.contentImageView);
}]; }];
[self.myInfoView mas_makeConstraints:^(MASConstraintMaker *make) { [self.myInfoView mas_makeConstraints:^(MASConstraintMaker *make) {