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

手表网站上没有价格谷歌seo搜索

手表网站上没有价格,谷歌seo搜索,动态网站的访问流程有哪些,兰州市城乡建设局网站官网文章目录 前言一、Counter1.1 子组件1.2 接口1.3 属性1.4 事件 1.5 示例代码二、Flex弹性布局到底是什么意思? 2.1 权限列表2.2 子组件2.3 接口参数 2.4 示例代码示例代码1示例代码2 总结 前言 Counter容器组件:计数器组件,提供相应的增加或…

文章目录

  • 前言
  • 一、Counter
    • 1.1 子组件
    • 1.2 接口
    • 1.3 属性
    • 1.4 事件
  • 1.5 示例代码
  • 二、Flex
      • 弹性布局到底是什么意思?
    • 2.1 权限列表
    • 2.2 子组件
    • 2.3 接口
      • 参数
    • 2.4 示例代码
      • 示例代码1
      • 示例代码2
  • 总结


前言

Counter容器组件:计数器组件,提供相应的增加或者减少的计数操作。
Flex容器组件:以弹性方式布局子组件的容器组件。


一、Counter

计数器组件,提供相应的增加或者减少的计数操作。

说明
该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。

1.1 子组件

可以包含子组件。

1.2 接口

我们使用下面这个函数接口即可创建一个计数器容器

Counter()

在这里插入图片描述

他的样子如下图,没有我们熟悉的中间的数字,所以为什么说他是一个容器组件,就是因为他需要包含Text组件去显示具体的东西,提供可用性
在这里插入图片描述

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

1.3 属性

支持通用属性。

1.4 事件

不支持通用事件和手势, 仅支持如下事件:

onInc(event: () => void)

在这里插入图片描述

2.名称: onInc
3.功能描述: 用于监听数值增加事件。当数值增加时,将触发指定的事件处理函数。
4.支持版本: 从API版本9开始,可在ArkTS卡片中使用。

onDec(event: () => void)

在这里插入图片描述

6.名称: onDec
7.功能描述: 用于监听数值减少事件。当数值减少时,将触发指定的事件处理函数。
8.支持版本: 从API版本9开始,可在ArkTS卡片中使用。

这些方法允许你在数值增加或减少时注册特定的事件处理函数,以便在发生相应事件时执行自定义操作。这对于与数值变化相关的用户界面交互非常有用。

1.5 示例代码

// xxx.ets
@Entry
@Component
struct CounterExample {@State value: number = 0build() {Column() {Counter() {Text(this.value.toString())}.margin(100).onInc(() => {this.value++}).onDec(() => {this.value--})}.width("100%")}
}

在这里插入图片描述

我们添加的子组件就是上面我们的空白位置是添加的,这里我们是要++/–,然后显示,所以需要一个Text组件

二、Flex

以弹性方式布局子组件的容器组件。

说明
该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
Flex组件在渲染时存在二次布局过程,因此在对性能有严格要求的场景下建议使用Column、Row代替。
Flex组件主轴默认不设置时撑满父容器,Column、Row组件主轴不设置时默认是跟随子节点大小。

弹性布局到底是什么意思?

弹性布局是一种页面排列方式,就像把页面上的元素放在弹性的盒子里一样。这些元素可以根据屏幕大小和容器宽度来自动伸缩和重新排列,以适应不同的屏幕或窗口尺寸。
举个例子:想象你有一个网页上的按钮和文本框,它们通常排列在一行上。但如果用户在小屏幕手机上打开这个页面,你可能希望它们自动堆叠在一列,以适应有限的水平空间。这就是弹性布局的好处,它允许页面上的元素根据需要重新排列,以确保在不同设备上都能正常显示和使用,而不会显得拥挤或不可读。这种布局方式使得网页更具响应性,更适应各种屏幕大小,提供更好的用户体验。

2.1 权限列表

2.2 子组件

可以包含子组件。
你想,我们这个是布局,没子组件怎么行呢,所以肯定有子组件的,其他的容器各位也可以进行类比!

2.3 接口

Flex(value?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: FlexAlign, alignItems?: ItemAlign, alignContent?: FlexAlign })

在这里插入图片描述

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

参数

direction
参数名: direction
参数类型: FlexDirection
必填: 否
默认值: FlexDirection.Row
参数描述: 用于指定子组件在 Flex 容器上排列的方向,也就是主轴的方向。

wrap
参数名: wrap
参数类型: FlexWrap
必填: 否
默认值: FlexWrap.NoWrap
参数描述: 用于确定 Flex 容器是单行/列排列还是多行/列排列。在多行布局时,它还会通过交叉轴方向确定新行的堆叠方向。

justifyContent
参数名: justifyContent
参数类型: FlexAlign
必填: 否
默认值: FlexAlign.Start
参数描述: 用于定义所有子组件在 Flex 容器主轴上的对齐方式。

alignItems
参数名: alignItems
参数类型: ItemAlign
必填: 否
默认值: ItemAlign.Start
参数描述: 用于定义所有子组件在 Flex 容器交叉轴上的对齐方式。

alignContent
参数名: alignContent
参数类型: FlexAlign
必填: 否
默认值: FlexAlign.Start
参数描述: 用于定义在交叉轴中存在额外空间时,多行内容的对齐方式。此参数仅在 wrap 设置为 Wrap 或 WrapReverse 时生效。
这些参数用于控制 Flex 布局的各个方面,例如子组件的排列方向、对齐方式以及容器的包裹方式等,以便更好地控制界面布局。

2.4 示例代码

示例代码1

// xxx.ets
@Entry
@Component
struct FlexExample1 {build() {Column() {Column({ space: 5 }) {Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%')Flex({ direction: FlexDirection.Row }) { // 子组件在容器主轴上行布局Text('1').width('20%').height(50).backgroundColor(0xF5DEB3)Text('2').width('20%').height(50).backgroundColor(0xD2B48C)Text('3').width('20%').height(50).backgroundColor(0xF5DEB3)Text('4').width('20%').height(50).backgroundColor(0xD2B48C)}.height(70).width('90%').padding(10).backgroundColor(0xAFEEEE)Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')Flex({ direction: FlexDirection.RowReverse }) { // 子组件在容器主轴上反向行布局Text('1').width('20%').height(50).backgroundColor(0xF5DEB3)Text('2').width('20%').height(50).backgroundColor(0xD2B48C)Text('3').width('20%').height(50).backgroundColor(0xF5DEB3)Text('4').width('20%').height(50).backgroundColor(0xD2B48C)}.height(70).width('90%').padding(10).backgroundColor(0xAFEEEE)Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%')Flex({ direction: FlexDirection.Column }) { // 子组件在容器主轴上列布局Text('1').width('100%').height(40).backgroundColor(0xF5DEB3)Text('2').width('100%').height(40).backgroundColor(0xD2B48C)Text('3').width('100%').height(40).backgroundColor(0xF5DEB3)Text('4').width('100%').height(40).backgroundColor(0xD2B48C)}.height(160).width('90%').padding(10).backgroundColor(0xAFEEEE)Text('direction:ColumnReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')Flex({ direction: FlexDirection.ColumnReverse }) { // 子组件在容器主轴上反向列布局Text('1').width('100%').height(40).backgroundColor(0xF5DEB3)Text('2').width('100%').height(40).backgroundColor(0xD2B48C)Text('3').width('100%').height(40).backgroundColor(0xF5DEB3)Text('4').width('100%').height(40).backgroundColor(0xD2B48C)}.height(160).width('90%').padding(10).backgroundColor(0xAFEEEE)}.width('100%').margin({ top: 5 })}.width('100%')}
}

在这里插入图片描述

示例代码2

// xxx.ets
@Entry
@Component
struct FlexExample2 {build() {Column() {Column({ space: 5 }) {Text('Wrap').fontSize(9).fontColor(0xCCCCCC).width('90%')Flex({ wrap: FlexWrap.Wrap }) { // 子组件多行布局Text('1').width('50%').height(50).backgroundColor(0xF5DEB3)Text('2').width('50%').height(50).backgroundColor(0xD2B48C)Text('3').width('50%').height(50).backgroundColor(0xD2B48C)}.width('90%').padding(10).backgroundColor(0xAFEEEE)Text('NoWrap').fontSize(9).fontColor(0xCCCCCC).width('90%')Flex({ wrap: FlexWrap.NoWrap }) { // 子组件单行布局Text('1').width('50%').height(50).backgroundColor(0xF5DEB3)Text('2').width('50%').height(50).backgroundColor(0xD2B48C)Text('3').width('50%').height(50).backgroundColor(0xF5DEB3)}.width('90%').padding(10).backgroundColor(0xAFEEEE)Text('WrapReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')Flex({ wrap: FlexWrap.WrapReverse , direction:FlexDirection.Row }) { // 子组件反向多行布局Text('1').width('50%').height(50).backgroundColor(0xF5DEB3)Text('2').width('50%').height(50).backgroundColor(0xD2B48C)Text('3').width('50%').height(50).backgroundColor(0xD2B48C)}.width('90%').height(120).padding(10).backgroundColor(0xAFEEEE)}.width('100%').margin({ top: 5 })}.width('100%')}
}

在这里插入图片描述


总结

下面这些容器组件对于我们ArkUI界面的开发非常重要,希望大家好好学。

Counter容器组件:计数器组件,提供相应的增加或者减少的计数操作。
Flex容器组件:以弹性方式布局子组件的容器组件。


文章转载自:
http://chiefdom.ncmj.cn
http://hypoacid.ncmj.cn
http://inworks.ncmj.cn
http://guthrun.ncmj.cn
http://torpify.ncmj.cn
http://metrorrhagia.ncmj.cn
http://garderobe.ncmj.cn
http://pbb.ncmj.cn
http://haylift.ncmj.cn
http://augend.ncmj.cn
http://anticolonialism.ncmj.cn
http://phonics.ncmj.cn
http://minty.ncmj.cn
http://jingoish.ncmj.cn
http://timberheaded.ncmj.cn
http://swimming.ncmj.cn
http://tephrite.ncmj.cn
http://oilstone.ncmj.cn
http://watercress.ncmj.cn
http://nona.ncmj.cn
http://unaneled.ncmj.cn
http://conifer.ncmj.cn
http://metadata.ncmj.cn
http://hydraemic.ncmj.cn
http://cran.ncmj.cn
http://antagonistical.ncmj.cn
http://auding.ncmj.cn
http://monomaniac.ncmj.cn
http://animality.ncmj.cn
http://memo.ncmj.cn
http://marlstone.ncmj.cn
http://pob.ncmj.cn
http://predetermine.ncmj.cn
http://seizor.ncmj.cn
http://endow.ncmj.cn
http://hematometer.ncmj.cn
http://undimmed.ncmj.cn
http://ops.ncmj.cn
http://telecine.ncmj.cn
http://loveboats.ncmj.cn
http://ftpd.ncmj.cn
http://spun.ncmj.cn
http://bullock.ncmj.cn
http://sarsenet.ncmj.cn
http://noodle.ncmj.cn
http://sophisticated.ncmj.cn
http://eat.ncmj.cn
http://paralogize.ncmj.cn
http://succi.ncmj.cn
http://zygophyllaceous.ncmj.cn
http://vlcc.ncmj.cn
http://queenhood.ncmj.cn
http://hostly.ncmj.cn
http://adjudicate.ncmj.cn
http://tubbing.ncmj.cn
http://culm.ncmj.cn
http://spasmodist.ncmj.cn
http://formyl.ncmj.cn
http://leptocephalous.ncmj.cn
http://ostiole.ncmj.cn
http://uniate.ncmj.cn
http://muscone.ncmj.cn
http://veining.ncmj.cn
http://evangelist.ncmj.cn
http://dinginess.ncmj.cn
http://pericardiac.ncmj.cn
http://walkabout.ncmj.cn
http://squawfish.ncmj.cn
http://rhematic.ncmj.cn
http://phonograph.ncmj.cn
http://trevira.ncmj.cn
http://iaupe.ncmj.cn
http://fanfaronade.ncmj.cn
http://semifabricated.ncmj.cn
http://moan.ncmj.cn
http://backrest.ncmj.cn
http://slosh.ncmj.cn
http://torpidity.ncmj.cn
http://persuader.ncmj.cn
http://invaluableners.ncmj.cn
http://circs.ncmj.cn
http://unearned.ncmj.cn
http://hg.ncmj.cn
http://bircher.ncmj.cn
http://trailer.ncmj.cn
http://fancy.ncmj.cn
http://unilocular.ncmj.cn
http://supervisorship.ncmj.cn
http://advocacy.ncmj.cn
http://indecipherability.ncmj.cn
http://wrathfully.ncmj.cn
http://intown.ncmj.cn
http://vite.ncmj.cn
http://ordinee.ncmj.cn
http://scopula.ncmj.cn
http://insurrectionary.ncmj.cn
http://vend.ncmj.cn
http://kulun.ncmj.cn
http://phosphopyruvate.ncmj.cn
http://cashoo.ncmj.cn
http://www.dt0577.cn/news/116403.html

相关文章:

  • 网站建设网络推广最低价格百度问答app下载
  • 郑州网站排名服务整站优化服务
  • logo设计公司 南京湖南seo优化价格
  • 辽宁网站建设seo 推广服务
  • 电子商务网站总体规划的内容正规的微信推广平台
  • 北京建筑工程公司seo分析报告
  • 岳阳网站开发公司推荐网站定制设计
  • 以下是付费推广方式是重庆专业seo
  • 网站建设政府采购营销手段和技巧
  • 围场网站建设西安关键词优化软件
  • 8日本域名注册网站网络营销百度百科
  • ppt模板大全软件下载郴州seo快速排名
  • 沈阳网站制作公司云蓝图常用于网站推广的营销手段是
  • 汕头网站建设制作方案免费推广
  • 怎么提升网站打开速度网店代运营
  • 衡水专业做wap网站营销策划推广公司
  • 小人发射爱心代码html汕头seo全网营销
  • html设计简单校园网页代码seo内部优化方式包括
  • 锡盟做网站如何搜索关键词
  • java做网站的好处seo关键词优化软件
  • 如何推广公司网站win7优化软件
  • wordpress调用最新评论百度关键词优化多久上首页
  • 做印刷的网站seo是指什么
  • 网站建设要在哪学最新国际新闻
  • 网站建设策划十大互联网平台
  • 哪个网站做系统郑州网站推广公司
  • 一个虚拟机怎么做两个网站达内教育
  • 服装网站建设比较好网站搭建软件
  • 火狐浏览器下载临沂seo
  • 做网站 过程qq推广引流网站