按键区
按键区是键盘的主要区域,用于放置各种按键。
按键区配置属性
Section titled “按键区配置属性”| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
keyboardHeight | Float 或 String | 否 | 按键区高度。支持 point 值或 vh 百分比写法,参见高度参数。 |
keyboardStyle | Object | 否 | 按键区样式节点。 |
keyboardLayout | Object[] | 是 | 按键区布局数组。布局写法参见布局。 |
keyboardStyle 支持以下属性:
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
insets | Insets | 否 | 按键区内边距,用于缩小 keyboardLayout 的布局范围。 |
backgroundStyle | String | 否 | 引用按键区背景样式节点。 |
配置示例:
keyboardHeight: '230'keyboardStyle: insets: { left: 2, right: 2, top: 2, bottom: 2 } backgroundStyle: keyboardBackgroundStylekeyboardLayout: - HStack: subviews: - Cell: qButton - Cell: wButton - Cell: eButton - Cell: rButton - Cell: tButton - Cell: yButton - Cell: uButton - Cell: iButton - Cell: oButton - Cell: pButton - HStack: subviews: - Cell: aButton - Cell: sButton - Cell: dButton - Cell: fButton - Cell: gButton - Cell: hButton - Cell: jButton - Cell: kButton - Cell: lButton - HStack: subviews: - Cell: shiftButton - Cell: zButton - Cell: xButton - Cell: cButton - Cell: vButton - Cell: bButton - Cell: nButton - Cell: mButton - Cell: backspaceButton - HStack: subviews: - Cell: 123Button - Cell: spaceButton - Cell: enterButton