Skip to content

按键区

按键区是键盘的主要区域,用于放置各种按键。

参数类型必选说明
keyboardHeightFloat 或 String按键区高度。支持 point 值或 vh 百分比写法,参见高度参数
keyboardStyleObject按键区样式节点。
keyboardLayoutObject[]按键区布局数组。布局写法参见布局

keyboardStyle 支持以下属性:

参数类型必选说明
insetsInsets按键区内边距,用于缩小 keyboardLayout 的布局范围。
backgroundStyleString引用按键区背景样式节点。

配置示例:

keyboardHeight: '230'
keyboardStyle:
insets: { left: 2, right: 2, top: 2, bottom: 2 }
backgroundStyle: keyboardBackgroundStyle
keyboardLayout:
- 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