如何禁用iOS 8表情符号键盘? [英] How to disable iOS 8 emoji keyboard?

查看:213
本文介绍了如何禁用iOS 8表情符号键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有选择停止在iOS 8中显示表情符号键盘?它不适用于小键盘和安全文本,但对于电子邮件,它就在那里。
如果无法禁用它如何从表情符号中获取字符串值?

Is there any option to stop showing the emoji keyboard in iOS 8? It is not available in numpad and secure text but for email it is there. If it is not possible to disable it how to get the string values from the emoji?

推荐答案

试试这个:

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{        
    if ([textField isFirstResponder])
    {
        if ([[[textField textInputMode] primaryLanguage] isEqualToString:@"emoji"] || ![[textField textInputMode] primaryLanguage])
        {
            return NO;
        }
    }
    return YES;
}

了解更多信息,请参阅这里

for more info see here.

编辑:

您可以使用以下代码隐藏键盘中的表情符号:

You can hide emoji from Keyboard using this code:

txtField.keyboardType=UIKeyboardTypeASCIICapable;

编辑:

使用界面构建器隐藏键盘中的表情符号选择。

Hide emoji selection from keyboard using Interface builder.

这篇关于如何禁用iOS 8表情符号键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆