13
我想编一个仅使用[return]
键的UIKeyCommand
。到目前为止,我已经试过:如何使用return/enter键创建UIKeyCommand?
UIKeyCommand *selectCommand = [UIKeyCommand keyCommandWithInput:@"\n" modifierFlags:0 action:@selector(chooseSelection:)];
还有的回车键没有全局常量,像有对上,下,左,右,和逃生(从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);
是还有什么我可以尝试捕获返回/输入密钥?
你可能希望'\ r'超过'\ n'。 –