如何通过swift打开表情符号键盘

时间:2016-04-28 06:08:26

标签: ios swift

我在视图上放置了一个文本字段,如果我键入文本字段,将显示一个键盘。我可以单击键盘上的输入更改按钮将输入语言更改为表情符号。现在我想让键盘显示的表情符号作为默认输入。如何用swift在ios上制作?

1 个答案:

答案 0 :(得分:2)

这是不可能的 - 用户只能在设置中更改其语言。

表情符号键盘实际上是用户必须设置的language设置,我们无法影响它。

keyboardType有一个UITextField属性:

typedef enum {
    UIKeyboardTypeDefault,                // Default type for the current input method.
    UIKeyboardTypeASCIICapable,           // Displays a keyboard which can enter ASCII characters, non-ASCII keyboards remain active
    UIKeyboardTypeNumbersAndPunctuation,  // Numbers and assorted punctuation.
    UIKeyboardTypeURL,                    // A type optimized for URL entry (shows . / .com prominently).
    UIKeyboardTypeNumberPad,              // A number pad (0-9). Suitable for PIN entry.
    UIKeyboardTypePhonePad,               // A phone pad (1-9, *, 0, #, with letters under the numbers).
    UIKeyboardTypeNamePhonePad,           // A type optimized for entering a person's name or phone number.
    UIKeyboardTypeEmailAddress,           // A type optimized for multiple email address entry (shows space @ . prominently).
    UIKeyboardTypeDecimalPad,             // A number pad including a decimal point
    UIKeyboardTypeTwitter,                // Optimized for entering Twitter messages (shows # and @)
    UIKeyboardTypeWebSearch,              // Optimized for URL and search term entry (shows space and .)

    UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable, // Deprecated

} UIKeyboardType;