gpt4 book ai didi

ios - 如何使用返回/输入键创建 UIKeyCommand?

转载 作者:IT王子 更新时间:2023-10-29 08:18:14 27 4
gpt4 key购买 nike

我想制作一个仅使用 [return] 键的 UIKeyCommand。到目前为止,我已经尝试过:

UIKeyCommand *selectCommand = [UIKeyCommand keyCommandWithInput:@"\n" modifierFlags:0 action:@selector(chooseSelection:)];

Enter 键没有全局常量,就像向上、向下、向左、向右和转义键一样(来自 UIResponder.h):

// These are pre-defined constants for use with the input property of UIKeyCommand objects.
UIKIT_EXTERN NSString *const UIKeyInputUpArrow NS_AVAILABLE_IOS(7_0);
UIKIT_EXTERN NSString *const UIKeyInputDownArrow NS_AVAILABLE_IOS(7_0);
UIKIT_EXTERN NSString *const UIKeyInputLeftArrow NS_AVAILABLE_IOS(7_0);
UIKIT_EXTERN NSString *const UIKeyInputRightArrow NS_AVAILABLE_IOS(7_0);
UIKIT_EXTERN NSString *const UIKeyInputEscape NS_AVAILABLE_IOS(7_0);

还有什么我可以 try catch 返回/输入键的吗?

最佳答案

使用 @"\r" 代替 @"\n" 换行应该可行。

关于ios - 如何使用返回/输入键创建 UIKeyCommand?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22027522/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com