固定键盘高度250

优化kbkeyboardview
优化ui
This commit is contained in:
2025-11-21 16:22:00 +08:00
parent c371c7224e
commit 0f4ca89060
5 changed files with 326 additions and 241 deletions

View File

@@ -22,7 +22,7 @@
- (void)kb_consumePendingShopSkin;
@end
static CGFloat KEYBOARDHEIGHT = 256 + 20;
static CGFloat KEYBOARDHEIGHT = 200 + 50;
static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
void *observer,
@@ -84,10 +84,17 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
- (void)setupUI {
// High
NSLayoutConstraint *h = [self.view.heightAnchor constraintEqualToConstant:KEYBOARDHEIGHT];
h.priority = UILayoutPriorityDefaultHigh; // 750
h.active = YES;
self.view.translatesAutoresizingMaskIntoConstraints = NO;
CGFloat keyboardHeight = KEYBOARDHEIGHT; // 250
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
NSLayoutConstraint *h = [self.view.heightAnchor constraintEqualToConstant:keyboardHeight];
NSLayoutConstraint *w = [self.view.widthAnchor constraintEqualToConstant:screenWidth];
h.priority = UILayoutPriorityRequired;
w.priority = UILayoutPriorityRequired;
[NSLayoutConstraint activateConstraints:@[h, w]];
// UIInputView
if ([self.view isKindOfClass:[UIInputView class]]) {
UIInputView *iv = (UIInputView *)self.view;
@@ -200,7 +207,9 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
- (void)keyBoardMainView:(KBKeyBoardMainView *)keyBoardMainView didTapToolActionAtIndex:(NSInteger)index {
if (index == 0) {
[self showFunctionPanel:YES];
///
[KBHUD showInfo:KBLocalized(@"Recharge Now")];
// [self showFunctionPanel:YES];
} else {
[self showFunctionPanel:NO];
}