修改引导逻辑

This commit is contained in:
2025-11-03 19:00:47 +08:00
parent edf88721da
commit cac2f13b88
4 changed files with 28 additions and 11 deletions

View File

@@ -46,7 +46,7 @@ typedef NS_ENUM(NSInteger, KBGuideItemType) {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self.view);
make.bottom.equalTo(self.inputBar.mas_top);
make.bottom.equalTo(self.view);
}];
[self.inputBar mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -108,22 +108,23 @@ typedef NS_ENUM(NSInteger, KBGuideItemType) {
[self kb_preparePermissionOverlayIfNeeded];
BOOL show = needGuide;
[UIView performWithoutAnimation:^{
// [UIView performWithoutAnimation:^{
self.permVC.view.hidden = !show;
}];
// }];
}
///
- (void)kb_preparePermissionOverlayIfNeeded {
if (self.permVC) return;
KBPermissionViewController *guide = [KBPermissionViewController new];
guide.modalPresentationStyle = UIModalPresentationFullScreen; // present
// guide.modalPresentationStyle = UIModalPresentationFullScreen; // present
KBWeakSelf;
guide.backHandler = ^{ [weakSelf.navigationController popViewControllerAnimated:YES]; };
self.permVC = guide;
guide.backButton.hidden = true;
[self addChildViewController:guide];
[self.view addSubview:guide.view];
[guide.view mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self.view); }];
// [guide.view mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self.view); }];
[guide didMoveToParentViewController:self];
guide.view.hidden = YES; //
}
@@ -172,12 +173,10 @@ typedef NS_ENUM(NSInteger, KBGuideItemType) {
self.inputBarBottom.offset = offset;
[UIView animateWithDuration:duration delay:0 options:curve animations:^{
[self.view layoutIfNeeded];
// contentInset
UIEdgeInsets inset = self.tableView.contentInset;
inset.bottom = 52 + MAX(kbHeight - safeBtm, 0);
self.tableView.contentInset = inset;
self.tableView.scrollIndicatorInsets = inset;
// self.tableView.scrollIndicatorInsets = inset;
} completion:^(BOOL finished) {
[self scrollToBottomAnimated:YES];
}];