seo怎么去优化网站,wordpress 进度条,以图搜图百度识图,苏州新区做网站公司组件提供勾选框样式、状态按钮样式及开关样式。该组件从API Version 8开始支持。 仅当ToggleType为Button时可包含子组件。 一、接口 Toggle(options: { type: ToggleType, isOn?: boolean }) 从API version 9开始#xff0c;该接口支持在ArkTS卡片中使用。 参数: Toggle… 组件提供勾选框样式、状态按钮样式及开关样式。该组件从API Version 8开始支持。 仅当ToggleType为Button时可包含子组件。 一、接口 Toggle(options: { type: ToggleType, isOn?: boolean }) 从API version 9开始该接口支持在ArkTS卡片中使用。 参数: ToggleType枚举说明 从API version 9开始该接口支持在ArkTS卡片中使用。 二、属性 除支持通用属性外还支持以下属性 三、事件 除支持通用事件外还支持以下事件 四、示例 // xxx.ets
Entry
Component
struct ToggleExample {build() {Column({ space: 10 }) {Text(type: Switch).fontSize(12).fontColor(0xcccccc).width(90%)Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {Toggle({ type: ToggleType.Switch, isOn: false }).selectedColor(#007DFF).switchPointColor(#FFFFFF).onChange((isOn: boolean) {console.info(Component status: isOn)})Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(#007DFF).switchPointColor(#FFFFFF).onChange((isOn: boolean) {console.info(Component status: isOn)})}Text(type: Checkbox).fontSize(12).fontColor(0xcccccc).width(90%)Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {Toggle({ type: ToggleType.Checkbox, isOn: false }).size({ width: 20, height: 20 }).selectedColor(#007DFF).onChange((isOn: boolean) {console.info(Component status: isOn)})Toggle({ type: ToggleType.Checkbox, isOn: true }).size({ width: 20, height: 20 }).selectedColor(#007DFF).onChange((isOn: boolean) {console.info(Component status: isOn)})}Text(type: Button).fontSize(12).fontColor(0xcccccc).width(90%)Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {Toggle({ type: ToggleType.Button, isOn: false }) {Text(status button).fontColor(#182431).fontSize(12)}.width(106).selectedColor(rgba(0,125,255,0.20)).onChange((isOn: boolean) {console.info(Component status: isOn)})Toggle({ type: ToggleType.Button, isOn: true }) {Text(status button).fontColor(#182431).fontSize(12)}.width(106).selectedColor(rgba(0,125,255,0.20)).onChange((isOn: boolean) {console.info(Component status: isOn)})}}.width(100%).padding(24)}
} 五、场景 在卡片中和单选多选配合使用可以做出各种选择框的效果。 本文根据HarmonyOS官方文档整理。