访问原生 iPhone、Android、Windows Phone 和 Windows 应用商店应用程序屏幕键盘的接口,在其他平台上不可用。
此接口可以显示不同类型的键盘:ASCII、
数字、URL、Email 和其他。
显示的键盘可能会遮挡
部分用户界面,在显示键盘时,
需要确保不会遮挡用户界面
部分。TouchScreenKeyboard.visible
和 TouchScreenKeyboard.area
应
用于确定键盘是否显示(激活)以及使用
哪部分屏幕。
Windows 应用商店应用程序:在通用 Windows 10 应用程序中,只有具有触摸输入支持的基于 XAML 的应用程序才支持触摸屏幕键盘。
area | 返回被键盘覆盖的屏幕部分。 |
hideInput | 当键盘在屏幕上时是否隐藏键盘上的文本输入字段? |
isSupported | 是否支持触摸屏幕键盘。 |
visible | 只要屏幕上有完全可见的键盘,就返回 true。 |
active | 键盘可见还是滑入屏幕位置? |
canGetSelection | 指定 TouchScreenKeyboard 是否支持 selection 属性。(只读) |
canSetSelection | 指定 TouchScreenKeyboard 是否支持 selection 属性。(只读) |
characterLimit | 键盘输入字段可以输入的字符数限制。0 = 无限。 |
selection | 获取或设置目前正在编辑的字符串中的所选文本的字符范围。 |
status | 返回屏幕键盘的状态。(只读) |
targetDisplay | 指定软件键盘将显示在哪个显示屏上。 |
text | 返回键盘的输入字段显示的文本。 |
type | 返回键盘的 TouchScreenKeyboardType。 |
Open | 在屏幕上打开操作系统提供的原生键盘。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.