mirror of
https://github.com/zlgopen/awtk.git
synced 2025-05-08 19:44:45 +08:00
add how_to_enable_keyboard_preview.md
This commit is contained in:
parent
79a4bb9052
commit
4e99d6a2a8
@ -96,6 +96,7 @@
|
||||
* [如何显示上下文菜单(俗称右键菜单)](how_to_show_context_menu.md)
|
||||
* [如何启用编辑器的上下文菜单](how_to_enable_edit_context_menu.md)
|
||||
* [如何设置下拉选择框 (combo box) 弹出窗口/列表项的样式](how_to_set_style_of_combo_box_item.md)
|
||||
* [如何支持软键盘按钮预览](how_to_enable_keyboard_preview.md)
|
||||
|
||||
### 3. 内部原理
|
||||
* [AWTK 脚本绑定原理](script_binding.md)
|
||||
|
@ -1,5 +1,8 @@
|
||||
# 最新动态
|
||||
|
||||
2022/10/01
|
||||
* 增加文档[如何支持软键盘按钮预览](how_to_enable_keyboard_preview.md)
|
||||
|
||||
2022/09/30
|
||||
* 按钮增加enable_preview属性,用于键盘中按钮preview。
|
||||
* 修复digit_clock在destroy的时候找不到窗口导致警告的问(感谢智明提供补丁)
|
||||
|
30
docs/how_to_enable_keyboard_preview.md
Normal file
30
docs/how_to_enable_keyboard_preview.md
Normal file
@ -0,0 +1,30 @@
|
||||
# 软键盘支持按键预览
|
||||
|
||||
## 一、介绍
|
||||
|
||||
在嵌入式系统中,通常屏幕很小。如果使用电容触摸屏,手指按下时会挡住其下的按钮,让人不确定是否按在了正确的位置,特别是在软键盘这种按钮按钮很密集的界面,更容易让人产生焦虑。
|
||||
|
||||
AWTK 支持了按钮预览的功能,可以大幅缓解这种焦虑。当按下按钮时,在上方显示一个放大的按钮,这种方法在 Android/iOS 中早已广泛使用,效果如下所示:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 二、使用方法
|
||||
|
||||
### 1. 基本方法
|
||||
|
||||
指定按钮的 enable_preview 属性为 true 即可,如:
|
||||
|
||||
```xml
|
||||
<button name="Q" enable_preview="true" text="Q"/>
|
||||
```
|
||||
|
||||
### 2. 在软键盘的候选字中使用
|
||||
|
||||
候选字按钮是动态创建的,没有办法在 XML 中为按钮指定,为此我们为 candidates 也增加了 enable_preview 属性:
|
||||
|
||||
```xml
|
||||
<candidates x="0" y="0" w="100%" h="30" enable_preview="true"/>
|
||||
```
|
||||
|
BIN
docs/images/keyboard_preview1.png
Normal file
BIN
docs/images/keyboard_preview1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 89 KiB |
BIN
docs/images/keyboard_preview2.png
Normal file
BIN
docs/images/keyboard_preview2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
Loading…
x
Reference in New Issue
Block a user