Unity3D说明文档翻译-Mobile Keyboard

Mobile Keyboard

手机键盘

In most cases, Unity will handle keyboard input automatically for GUI elements but it is also easy to show the keyboard on demand from a script.

在大多数情况下,Unity将通过GUI元素自动处理键盘输入,但也容易通过脚本即时显示键盘.

GUI Elements

GUI元素

The keyboard will appear automatically when a user taps on editable GUI elements. Currently,GUI.TextFieldGUI.TextArea and GUI.PasswordField will display the keyboard; see the GUI class documentation for further details.

当用户在可编辑GUI元素上点击键盘将自动显示.当前地,GUI.TextField,GUI.TextArea和GUI.PasswordField将显示键盘,参考GUI类文档获取更详细信息.

Manual Keyboard Handling

键盘处理手册

Use the TouchScreenKeyboard.Open() function to open the keyboard. Please see theTouchScreenKeyboard scripting reference for the parameters that this function takes.

使用TouchScreenKeyboard.Open()函数打开键盘.请查看TouchScreenKeyboard脚本参考和它参数的功能.

Keyboard Layout Options

键盘布局选项

The Keyboard supports the following options:

键盘支持下列选项:

Property:

属性:

Function:

功能

TouchScreenKeyboardType.Default

触摸屏键盘类型.默认

Letters. Can be switched to keyboard with numbers and punctuation.

字母.可使用数字和标点符号切换到键盘

TouchScreenKeyboardType.ASCIICapable

触摸屏键盘类型.ASCII可用

Letters. Can be switched to keyboard with numbers and punctuation.

字母.可使用数字和标点符号切换到键盘

TouchScreenKeyboardType.NumbersAndPunctuation

触摸屏键盘类型.数字和标点

Numbers and punctuation. Can be switched to keyboard with letters.

数字和标点.可使用字母切换到键盘

TouchScreenKeyboardType.URL

触摸屏键盘类型.URL

Letters with slash and .com buttons. Can be switched to keyboard with numbers and punctuation.

倾斜字母和.com按钮.可使用数字和标点切换到键盘

TouchScreenKeyboardType.NumberPad

触摸屏键盘类型.平板数字

Only numbers from 0 to 9.

仅从0到9的数字

TouchScreenKeyboardType.PhonePad

触摸屏键盘类型.平板电话

Keyboard used to enter phone numbers.

用于输入电话数字的键盘

TouchScreenKeyboardType.NamePhonePad

触摸屏键盘类型.平板电话名字

Letters. Can be switched to phone keyboard.

字母.可切换到电话键盘

TouchScreenKeyboardType.EmailAddress

触摸屏键盘类型.邮箱地址

Letters with @ sign. Can be switched to keyboard with numbers and punctuation.

带@字符的字母.可用数字和标点切换到键盘

Text Preview

文本预览

By default, an edit box will be created and placed on top of the keyboard after it appears. This works as preview of the text that user is typing, so the text is always visible for the user. However, you can disable text preview by setting TouchScreenKeyboard.hideInput to true. Note that this works only for certain keyboard types and input modes. For example, it will not work for phone keypads and multi-line text input. In such cases, the edit box will always appear.TouchScreenKeyboard.hideInput is a global variable and will affect all keyboards.

默认,一个编辑框将创建和放置到键盘顶部.这是用户输入文本的预览,所以文本对于用户总是可见.然而,你可以通过设置触屏键盘->隐藏输入为ture禁用文本预览.注意,此仅工作在确定键盘类型和输入模式.例如,它将不工作在电话平板键盘和多行文本输入.在这种情况下,编辑框将总是显示.触屏键盘->隐藏输入是一个全局变量并且将影响所有键盘.

Visibility and Keyboard Size

可见性和键盘大小

There are three keyboard properties in TouchScreenKeyboard that determine keyboard visibility status and size on the screen.

这里有3种键盘属性在触屏键盘类以确定键盘在屏幕上的可见性状态和大小.

Property:

属性:

Function:

功能:

Visible

可见性

Returns true if the keyboard is fully visible on the screen and can be used to enter characters.

如果键盘在屏幕上完全可见且可用于输入字符,返回ture.

Area

区域

Returns the position and dimensions of the keyboard.

返回键盘的位置和规模

Active

活动

Returns true if the keyboard is activated. This property is not static property. You must have a keyboard instance to use this property.

如果键盘是活动的返回ture.此属性不是静态属性.你必须有一个键盘使用此属性来实例.

 

Note that TouchScreenKeyboard.area will return a Rect with position and size set to 0 until the keyboard is fully visible on the screen. You should not query this value immediately after TouchScreenKeyboard.Open(). The sequence of keyboard events is as follows:

注意,触屏键盘->区域将返回一个带有位置和大小为0的矩形直到键盘完全显示在屏幕上.你需要在TouchScreenKeyboard.Open()后立即查询此值.键盘事件序列如下:

1. TouchScreenKeyboard.Open() is called. TouchScreenKeyboard.active returns true.TouchScreenKeyboard.visible returns false. TouchScreenKeyboard.area returns (0, 0, 0, 0).

2. Keyboard slides out into the screen. All properties remain the same.

3. Keyboard stops sliding. TouchScreenKeyboard.active returns true.TouchScreenKeyboard.visible returns true. TouchScreenKeyboard.area returns real position and size of the keyboard.

 

调用TouchScreenKeyboard.Open()函数.TouchScreenKeyboard.active返回ture.TouchScreenKeyboard.visible返回false.TouchScreenKeyboard.area返回(0,0,0,0).

键盘滑出到屏幕上.所有属性相同.

键盘停止滑动.TouchScreenKeyboard.active 返回 true.TouchScreenKeyboard.visible 返回 true. TouchScreenKeyboard.area返回键盘真实位置和大小.

Secure Text Input

文本输入安全

It is possible to configure the keyboard to hide symbols when typing. This is useful when users are required to enter sensitive information (such as passwords). To manually open keyboard with secure text input enabled, use the following code:

可以配置当输入时键盘隐藏符号.这对当用户要输入敏感信息时非常有用(如密码).手动打开键盘文本输入安全,使用下列代码:

TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false, false, true);

 

 

Hiding text while typing

输入时隐藏文本

Alert keyboard

弹出框键盘

To display the keyboard with a black semi-transparent background instead of the classic opaque, call TouchScreenKeyboard.Open() as follows:

显示键盘为一个黑色半透明背景以替代经典的不透明,调用TouchScreenKeyboard.Open()如下:

TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false, false, true, true);

 

 

Classic keyboard

经典键盘

Alert keyboard

弹出框键盘

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: antd-mobile-vue是一个基于Vue.js框架的移动端组件库,它提供了一系列UI组件,用于开发高质量的移动端应用。 与其它UI组件库相比,antd-mobile-vue具有以下优势和特点: 1. 高质量的组件:antd-mobile-vue提供了丰富的移动端UI组件,如按钮、表单、弹窗、导航等,这些组件都经过了精心设计和开发,具有统一的风格和良好的用户体验。 2. 灵活的布局:antd-mobile-vue提供了灵活的布局组件,如栅格布局、Flex布局,可帮助开发者快速搭建页面结构,并自适应不同的屏幕尺寸。 3. 易于使用和扩展:antd-mobile-vue的组件使用简单,开发者可以通过简单的配置和参数就可以实现复杂的交互效果。而且,antd-mobile-vue的组件提供了丰富的扩展能力,可以根据项目需求进行个性化的定制。 4. 生态丰富:antd-mobile-vue拥有庞大的开发者社区和活跃的维护团队,开发者可以通过官方文档和社区资源获取帮助和支持。此外,antd-mobile-vue还与其它Vue.js生态工具和库良好地兼容,如Vue Router、Vue CLI等。 5. 支持国际化:antd-mobile-vue提供了多语言支持,开发者可以根据项目需求灵活地切换多种语言环境。 总之,antd-mobile-vue是一个功能强大、易于使用和扩展的移动端组件库,它可以帮助开发者快速构建高质量的移动端应用,提高开发效率和用户体验。 ### 回答2: antd-mobile-vue是一种基于Vue.js框架的移动端UI库。它是对Ant Design Mobile的Vue组件实现的封装和扩展,旨在为开发者提供高质量、易用性的移动端组件库,帮助快速开发移动应用程序。 antd-mobile-vue提供了丰富的移动端UI组件,如按钮、导航栏、标签栏、列表、表单等,可以满足日常开发中绝大部分的界面需求。这些组件都经过精心设计和优化,在视觉和交互上都符合当前移动端的设计原则和用户体验。而且,它还提供了灵活的定制和扩展能力,允许开发者根据具体需求进行个性化定制,提高开发效率和用户体验。 除了UI组件外,antd-mobile-vue还提供了一些实用的工具和功能,如样式工具库、语言国际化、路由管理等。这些工具和功能都是为了让开发者更方便地进行移动应用开发,减少重复性的工作,提高开发效率。 antd-mobile-vue拥有广泛的社区支持和文档资料,开发者可以从社区中获取帮助和解决问题,学习和掌握使用该库的技巧和最佳实践。同时,antd-mobile-vue还提供了详细的官方文档和示例代码,方便开发者快速入手和上手该库。 总之,antd-mobile-vue是一款功能强大、易用性强的移动端UI库,适用于各种移动应用的开发。无论是个人开发者还是团队开发,都可以通过使用antd-mobile-vue来快速构建高质量的移动应用程序。 ### 回答3: antd-mobile-vue 是一个基于 Vue.js 的移动端 UI 组件库,它提供了丰富的移动端组件和样式风格,可以帮助开发者快速构建优雅的移动端应用。 antd-mobile-vue 的特点有以下几个方面: 1. 高度可定制:antd-mobile-vue 提供了大量的组件,涵盖了移动端常见的UI元素,如按钮、导航栏、表单等,这些组件的样式和交互行为都可以通过配置进行定制,满足不同项目的需求。 2. 兼容性强:antd-mobile-vue 提供了对不同移动端浏览器和操作系统的支持,保证组件在不同环境下的正常运行和展示,同时也保证了用户的使用体验。 3. 特色设计:antd-mobile-vue 的设计风格简洁、现代,符合移动端用户的审美要求,同时也遵循了 Material Design 和 iOS Human Interface Guidelines 等设计准则,保证了用户的熟悉感和易用性。 4. 文档丰富:antd-mobile-vue 提供了详细的文档和示例代码,开发者可以根据文档了解组件的使用方法和配置参数,快速上手使用。 5. 生态丰富:antd-mobile-vue 是基于 Ant Design Mobile(antd-mobile)的 Vue 实现,可以与其它 Vue 生态工具和插件无缝集成,如 Vue Router、Vuex 等,方便开发者构建复杂的移动应用。 总之,antd-mobile-vue 是一个强大而灵活的移动端 UI 组件库,它可以帮助开发者节省时间和精力,快速开发出高质量的移动应用。无论是个人项目还是企业应用,都可以考虑使用这个库来提升开发效率和用户体验。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值