处理苹果bug 默认键盘颜色改为

This commit is contained in:
2025-12-22 13:29:00 +08:00
parent eaaf0e1ed6
commit ea77e9a5f8
4 changed files with 16 additions and 3 deletions

View File

@@ -25,7 +25,8 @@
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [KBSkinManager shared].current.keyboardBackground;
// self.backgroundColor = [KBSkinManager shared].current.keyboardBackground;
self.backgroundColor = [UIColor colorWithHex:0xD1D3DB];
//
self.topBar = [[KBToolBar alloc] init];
@@ -205,7 +206,8 @@
- (void)kb_applyTheme {
KBSkinManager *mgr = [KBSkinManager shared];
BOOL hasImg = ([mgr currentBackgroundImage] != nil);
UIColor *bg = mgr.current.keyboardBackground;
// UIColor *bg = mgr.current.keyboardBackground;
UIColor *bg = [UIColor colorWithHex:0xD1D3DB];
self.backgroundColor = hasImg ? [UIColor clearColor] : bg;
self.keyboardView.backgroundColor = hasImg ? [UIColor clearColor] : bg;
if ([self.topBar respondsToSelector:@selector(kb_applyTheme)]) {

View File

@@ -31,6 +31,7 @@
"Invalid login credential" = "Invalid login credential";
"No token returned" = "No token returned";
"Failed to save login state" = "Failed to save login state";
"登录已取消" = "Sign-in canceled";
"请切换到主App完成登录" = "Please switch to the main app to finish signing in";
"Continue Via Email" = "Continue Via Email";
"Login With Email Password" = "Login With Email Password";

View File

@@ -31,6 +31,7 @@
"Invalid login credential" = "无效的登录凭证";
"No token returned" = "未返回 token";
"Failed to save login state" = "保存登录态失败";
"登录已取消" = "登录已取消";
"请切换到主App完成登录" = "请切换到主App完成登录";
"Continue Via Email" = "通过邮箱登录";
"Login With Email Password" = "使用邮箱密码登录";

View File

@@ -106,7 +106,16 @@ static NSString * const kKBAppleUserIdentifierKey = @"com.company.keyboard.apple
- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithError:(NSError *)error API_AVAILABLE(ios(13.0)) {
if (self.completion) {
self.completion(nil, error);
NSError *finalError = error;
if (@available(iOS 13.0, *)) {
if ([error.domain isEqualToString:ASAuthorizationErrorDomain] && error.code == ASAuthorizationErrorCanceled) {
finalError = [NSError errorWithDomain:error.domain
code:error.code
userInfo:@{NSLocalizedDescriptionKey: KBLocalized(@"登录已取消")
}];
}
}
// self.completion(nil, finalError);
}
self.completion = nil;
self.presentingVC = nil;