[LayaAirIDE2]打包app后,textInput获得光标如何不自动弹出虚拟键盘?
问题1:请教一下打包app后,textInput获得光标如何不自动弹出虚拟键盘?
问题2:如何判断ipad、iphone是否连接了外置键盘?
问题2:如何判断ipad、iphone是否连接了外置键盘?
没有找到相关结果
已邀请:
要回复问题请先登录
没有找到相关结果
要回复问题请先登录
1 个回复
1567600631用户
赞同来自:
- (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");