[LayaAirIDE2]打包app后,textInput获得光标如何不自动弹出虚拟键盘?

问题1:请教一下打包app后,textInput获得光标如何不自动弹出虚拟键盘?
问题2:如何判断ipad、iphone是否连接了外置键盘?
已邀请:

1567600631用户

赞同来自:

#import <UIKit/UIKit.h>

- (BOOL)isExternalKeyboardConnected {
    UITextInputMode *currentInputMode = [UITextInputMode currentInputMode];
    if (currentInputMode.primaryLanguage == nil) {
        return YES; // 外置键盘连接
    } else {
        return NO; // 未连接外置键盘
    }
}

// 测试
BOOL externalKeyboardConnected = [self isExternalKeyboardConnected];
NSLog(externalKeyboardConnected ? @"External keyboard connected" : @"External keyboard not connected");

要回复问题请先

商务合作
商务合作