当前位置: 首页 > news >正文

太原高端网站建设微信在线登录平台

太原高端网站建设,微信在线登录平台,湖北省住房建设厅网站首页,网站建设进度滑动条组件,通常用于快速调节设置值,如音量调节、亮度调节等应用场景。该组件从API Version 7开始支持。无子组件 一、接口 Slider(options?: {value?: number, min?: number, max?: number, step?: number, style?: SliderStyle, direction?: Ax…

滑动条组件,通常用于快速调节设置值,如音量调节、亮度调节等应用场景。该组件从API Version 7开始支持。无子组件
一、接口
Slider(options?: {value?: number, min?: number, max?: number, step?: number, style?: SliderStyle, direction?: Axis, reverse?: boolean})
从API version 9开始,该接口支持在ArkTS卡片中使用。
参数:
 

HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Slider-开源基础软件社区


 

HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Slider-开源基础软件社区


SliderStyle枚举说明
从API version 9开始,该接口支持在ArkTS卡片中使用。
 

HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Slider-开源基础软件社区


二、属性
支持除触摸热区以外的通用属性设置。
 

HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Slider-开源基础软件社区


 

HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Slider-开源基础软件社区


三、事件
通用事件仅支持挂载卸载事件:OnAppear,OnDisAppear。
 

HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Slider-开源基础软件社区


SliderChangeMode枚举说明
从API version 9开始,该接口支持在ArkTS卡片中使用。
 

HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Slider-开源基础软件社区


四、示例

// xxx.ets
@Entry
@Component
struct SliderExample {@State outSetValueOne: number = 40@State inSetValueOne: number = 40@State outSetValueTwo: number = 40@State inSetValueTwo: number = 40@State vOutSetValueOne: number = 40@State vInSetValueOne: number = 40@State vOutSetValueTwo: number = 40@State vInSetValueTwo: number = 40build() {Column({ space: 8 }) {Text('outset slider').fontSize(9).fontColor(0xCCCCCC).width('90%').margin(15)Row() {Slider({value: this.outSetValueOne,min: 0,max: 100,style: SliderStyle.OutSet}).showTips(true).onChange((value: number, mode: SliderChangeMode) => {this.outSetValueOne = valueconsole.info('value:' + value + 'mode:' + mode.toString())})// toFixed(0)将滑动条返回值处理为整数精度Text(this.outSetValueOne.toFixed(0)).fontSize(12)}.width('80%')Row() {Slider({value: this.outSetValueTwo,step: 10,style: SliderStyle.OutSet}).showSteps(true).onChange((value: number, mode: SliderChangeMode) => {this.outSetValueTwo = valueconsole.info('value:' + value + 'mode:' + mode.toString())})Text(this.outSetValueTwo.toFixed(0)).fontSize(12)}.width('80%')Text('inset slider').fontSize(9).fontColor(0xCCCCCC).width('90%').margin(15)Row() {Slider({value: this.inSetValueOne,min: 0,max: 100,style: SliderStyle.InSet}).blockColor('#191970').trackColor('#ADD8E6').selectedColor('#4169E1').showTips(true).onChange((value: number, mode: SliderChangeMode) => {this.inSetValueOne = valueconsole.info('value:' + value + 'mode:' + mode.toString())})Text(this.inSetValueOne.toFixed(0)).fontSize(12)}.width('80%')Row() {Slider({value: this.inSetValueTwo,step: 10,style: SliderStyle.InSet}).blockColor('#191970').trackColor('#ADD8E6').selectedColor('#4169E1').showSteps(true).onChange((value: number, mode: SliderChangeMode) => {this.inSetValueTwo = valueconsole.info('value:' + value + 'mode:' + mode.toString())})Text(this.inSetValueTwo.toFixed(0)).fontSize(12)}.width('80%')Row() {Column() {Text('vertical outset slider').fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15)Row() {Slider({value: this.vOutSetValueOne,style: SliderStyle.OutSet,direction: Axis.Vertical}).blockColor('#191970').trackColor('#ADD8E6').selectedColor('#4169E1').showTips(true).onChange((value: number, mode: SliderChangeMode) => {this.vOutSetValueOne = valueconsole.info('value:' + value + 'mode:' + mode.toString())})Slider({value: this.vOutSetValueTwo,step: 10,style: SliderStyle.OutSet,direction: Axis.Vertical}).blockColor('#191970').trackColor('#ADD8E6').selectedColor('#4169E1').showSteps(true).onChange((value: number, mode: SliderChangeMode) => {this.vOutSetValueTwo = valueconsole.info('value:' + value + 'mode:' + mode.toString())})}}.width('50%').height(300)Column() {Text('vertical inset slider').fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15)Row() {Slider({value: this.vInSetValueOne,style: SliderStyle.InSet,direction: Axis.Vertical,reverse: true // 竖向的Slider默认是上端是min值,下端是max值,因此想要从下往上滑动,需要设置reverse为true}).showTips(true).onChange((value: number, mode: SliderChangeMode) => {this.vInSetValueOne = valueconsole.info('value:' + value + 'mode:' + mode.toString())})Slider({value: this.vInSetValueTwo,step: 10,style: SliderStyle.InSet,direction: Axis.Vertical,reverse: true}).showSteps(true).onChange((value: number, mode: SliderChangeMode) => {this.vInSetValueTwo = valueconsole.info('value:' + value + 'mode:' + mode.toString())})}}.width('50%').height(300)}}.width('100%')}
}

五、效果样式

HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Slider-开源基础软件社区

六、场景
适合卡片上直接操作提示滑动条组件,通常用于快速调节设置值,如音量调节、亮度调节等应用场景提供。

本文根据HarmonyOS官方文档整理

http://www.yayakq.cn/news/610722/

相关文章:

  • 怎么在互联网上建立网站中文网站的英文
  • 天津网站开发价格网站注册域名备案
  • 安徽省建设厅网站 职称抖音代运营报价明细表
  • 现货黄金什么网站可以做直播宁德市是哪个省
  • 住房和城市建设部网站网站建设信息公开和解读回应
  • 外国购物网站设计风格温州网站建设及推广
  • 在哪找人做网站wordpress 后台相册管理
  • 宁德商城网站建设net域名 著名网站
  • 惠州市建网站公司wordpress 部署报错
  • 单页网站的优点做个什么网站
  • 网站如何做诺顿认证wordpress 当前位置 插件
  • 环保网站建设说明做网站干什么用
  • 微网站开发视频教程食品网站建设实施方案
  • 4435建站平面设计如何在家接单
  • 如何建立自己生活网站如何做网站教程
  • 网站域名注册流程广州网站制作多少钱
  • 自己建网站百度到吗seo服务器配置
  • h5网站和传统网站区别.net做的网站
  • 网站建设 自查表如何构建成交型网站
  • 怎么推广网站平台怎么介绍自己做的网页
  • 网站托管就业网站开发怎么让别人看到
  • 企业网站备案后可否更改名称网站不想续费
  • 电子商务网站界面设计广州科技有限公司
  • 东莞网站建设营销网站广州公司注册最新流程
  • 网站封面怎么做装潢设计什么意思
  • 开发网站开发工程师网站建设找泉州效率网络
  • 资源站建站技术数码产品简约大气网站设计
  • 学校网站建设风险分析wordpress调用目录
  • 个人 备案 多个网站吗孝感网站开发优搏好
  • 怎样进行站点优化做网站的流程视频教程