配置参数
buttonStyleType
Section titled “buttonStyleType”类型:'geometry' | 'systemImage' | 'assetImage' | 'fileImage' | 'text'
必选项:是
用于标识样式的类型,不同类型的样式,所支持解析的配置参数不同。
geometry:表示使用 iOS 原生属性绘制样式systemImage:使用 SF Symbols 图标assetImage:使用 App 内部的图片资源fileImage:使用皮肤中的图片文件作为样式text:使用文本作为样式
backgroundStyle
Section titled “backgroundStyle”类型:String | Array<ConditionStyle> | undefined
用来引用按键的背景样式。
foregroundStyle
Section titled “foregroundStyle”类型:String | Array<String> | Array<ConditionStyle> | undefined
用来引用按键的前景样式。
notification
Section titled “notification”类型:String | Array<String>
为按键绑定通知。此属性只能在按键样式中使用。
notificationType
Section titled “notificationType”类型:'rime' | 'keyboardAction' | 'returnKeyType'
必选项:是
用于标识监听的通知的类型,不同类型的通知,所支持解析的配置参数不同。
rime:表示 RIME 输入法的通知keyboardAction:表示键盘按键动作的通知returnKeyType:表示回车键类型的通知
rimeNotificationType
Section titled “rimeNotificationType”类型:'optionChanged' | 'schemaChanged'
必选项:是
用于标识 RIME 输入法的通知类型,不同类型的通知,所支持解析的配置参数不同。
optionChanged:表示 option 配置选项变更schemaChanged:表示输入方案变更
rimeOptionName
Section titled “rimeOptionName”类型:String
必选项:否,当 rimeNotificationType 设置为 'optionChanged' 时,此项为必选。
用于标识 RIME 输入法的配置选项名称。
rimeOptionValue
Section titled “rimeOptionValue”类型:Bool
必选项:否,当 rimeNotificationType 设置为 'optionChanged' 时,此项为必选。
用于标识 RIME 输入法的配置选项值。
notificationKeyboardAction
Section titled “notificationKeyboardAction”类型: KeyboardAction
必选项:否,当 notificationType 设置为 'keyboardAction' 时,此项为必选。
用于标识监听键盘触发的 KeyboardAction 的类型。
当键盘通知的 action 与当前设置的 notificationKeyboardAction 类型匹配时,会触发样式变更。当 action 值不匹配时,样式恢复为默认状态。
returnKeyType
Section titled “returnKeyType”类型:Int | [Int]
必选项:否,当 notificationType 设置为 'returnKeyType' 时,此项为必选。
用于标识回车键的类型。
当系统回车键类型与当前设置的 returnKeyType 类型匹配时,会触发样式变更。当回车键类型值不匹配时,样式恢复为默认状态。
animationType
Section titled “animationType”类型:'scale' | 'cartoon' | 'physics'
必选项:是
用于标识动画的类型,不同类型的动画,所支持解析的配置参数不同。
scale:表示缩放动画cartoon:表示卡通动画,用来替代之前版本的 APNG 图片physics:表示物理动画,可以用来描述移动、旋转、透明度变化等
ConditionStyle 条件样式
Section titled “ConditionStyle 条件样式”部分按键的样式需要根据条件判断来决定,例如:符号键盘锁定按键的样式,它初始显示时需要根据当前锁定状态来决定显示样式。
类型:{ conditionKey: String, conditionValue: Bool | Array<Int>, styleName: String }
配置示例:
foregroundStyle: - { styleName: unlockButtonForegroundStyle, conditionKey: $symbolicKeyboardLockState, conditionValue: false, } - { styleName: lockButtonForegroundStyle, conditionKey: $symbolicKeyboardLockState, conditionValue: true, }conditionKey
Section titled “conditionKey”类型:'$symbolicKeyboardLockState' | 'rime${optionName}'
$symbolicKeyboardLockState:表示符号键盘的锁定状态rime${optionName}:表示 RIME option 状态,比如rime$ascii_mode表示ascii_mode选项的状态
浮动键盘相关参数
Section titled “浮动键盘相关参数”floatKeyboardLockedState
Section titled “floatKeyboardLockedState”类型:Bool
浮动键盘的锁定状态。默认为 true,即:点击浮动键盘上的按键后,自动隐藏浮动键盘;当设置为 false 时,点击浮动键盘上的按键后,不会自动隐藏浮动键盘。
floatKeyboardAlpha
Section titled “floatKeyboardAlpha”类型:Float
浮动键盘背景透明度。取值范围为 0.1 到 1.0 之间,默认为 0.95。
注意:请勿使用
0.0作为透明度值,否则会导致浮动键盘点击空白区域后,不会关闭当前浮动键盘。