如何只为输入实现表情符号键盘? [英] How to implement only emoji keyboard for Entry?

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

问题描述

当用户将重点放在条目"上时,我想实现自定义条目"(Xamarin.forms),设备将显示Emoji键盘.

I would like to implement Custom Entry (Xamarin.forms) when the user focus the Entry, device will show Emoji keyboard.

推荐答案

简短答案

不幸的是,由于Android和iOS平台的局限性,如果不创建自己的键盘是不可能的.

Unfortunately it is impossible without creating your own keyboard, due to Android and iOS platform limitations.

详细答案

iOS上的默认行为是在键盘底部显示表情符号键盘图标.因此,只需轻轻一按即可:

Default behaviour on iOS is to show the emoji keyboard icon in the bottom of the keyboard. So it is only one tap away from the user:

Android上的默认行为似乎略有不同,并且默认情况下隐藏了表情符号键盘:


幸运的是,通过将 InputType 设置为 Android.Text.InputTypes.TextVariationShortMessage |,放置表情符号键盘图标非常容易.Android.Text.InputTypes.ClassText :

Default behaviour on Android is seems to be slightly different and the emoji keyboard is hidden by default:


Luckily, it is very easy to place the emoji keyboard icon by setting the InputType to Android.Text.InputTypes.TextVariationShortMessage | Android.Text.InputTypes.ClassText:

如果您仍然希望默认显示表情符号键盘,那么恐怕您将必须实现自己的键盘视图.根据您的需要,您可以添加一些表情符号作为按钮等.

If you are still looking to show the emoji keyboard by default, I am afraid you will have to implement your own keyboard view. Depend on your needs you could add few emojis as buttons and etc.

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

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