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

杭州做网站的网络公司有哪些360竞价推广开户多少钱

杭州做网站的网络公司有哪些,360竞价推广开户多少钱,天猫折扣店网站建设,新网网站负责人核验现场拍摄照片电子件介绍一下鸿蒙开发常用4种布局 1、线性布局 2、层叠布局 3、网格布局 4、列表布局 ​1. 线性布局(Column/Row) 线性布局(LinearLayout)是开发中最常用的布局,通过线性容器Row(行)和Column&…

介绍一下鸿蒙开发常用4种布局

1、线性布局
2、层叠布局
3、网格布局
4、列表布局

​1. 线性布局(Column/Row)

线性布局(LinearLayout)是开发中最常用的布局,通过线性容器Row(行)和Column(列)构建,它是其他布局的基础,其子元素在线性方向上(水平或垂直)依次排列,基本形式如下:
Column(列)
子元素在排列方向上的间距,可以通过组件参数space参数进行控制

@Entry
@Component
struct Index {build() {Column({space:20}) {//一行Row() {}.width('80%').height(50).backgroundColor(Color.Green)Row() {}.width('80%').height(50).backgroundColor(Color.Orange)Row() {}.width('80%').height(50).backgroundColor(Color.Yellow)Row() {}.width('80%').height(50).backgroundColor(Color.Blue)Row() {}.width('80%').height(50).backgroundColor(Color.Red)}.width('100%').alignItems(HorizontalAlign.Center)}
}

效果:
在这里插入图片描述
Row(行)

@Entry
@Component
struct Index {build() {Row({space:20}) {Column() {}.width('15%').height(50).backgroundColor(Color.Red);Column() {}.width('15%').height(50).backgroundColor(Color.Orange);Column() {}.width('15%').height(50).backgroundColor(Color.Red);Column() {}.width('15%').height(50).backgroundColor(Color.Blue);Column() {}.width('15%').height(50).backgroundColor(Color.Pink);}.width('100%').padding(20).backgroundColor('#ccc')}
}

在这里插入图片描述
子元素排列与对齐
● 主轴:线性布局容器在布局方向上的轴线,Row容器主轴为横向,Column容器主轴为纵向。
● 交叉轴:垂直于主轴方向的轴线。Row容器交叉轴为纵向,Column容器交叉轴为横向。
子元素沿主轴方向的排列方式
可以通过justifyContent 属性进行控制,可选值如下:

@Entry
@Component
struct Index {build() {Column({space:20}) {//一行Row() {}.width('80%').height(50).backgroundColor(Color.Green)Row() {}.width('80%').height(50).backgroundColor(Color.Red)}.width('100%').height('100%').justifyContent(FlexAlign.Center)}
}

.justifyContent(FlexAlign.Center)
在这里插入图片描述
.justifyContent(FlexAlign.Start)
在这里插入图片描述
.justifyContent(FlexAlign.End)
在这里插入图片描述
.justifyContent(FlexAlign.SpaceBetween)
在这里插入图片描述
.justifyContent(FlexAlign.SpaceAround)
在这里插入图片描述
.justifyContent(FlexAlign.SpaceEvenly)
在这里插入图片描述
子元素沿交叉轴方向的对齐方式
可以通过alignItems 属性进行控制,可选值如下:

@Entry
@Component
struct Index {build() {Column() {Row() {}.width('80%').height(50).backgroundColor(Color.Red)Row() {}.width('80%').height(50).backgroundColor(Color.Orange)Row() {}.width('80%').height(50).backgroundColor(Color.Yellow)}.width('100%').height('100%').alignItems(HorizontalAlign.Start)}
}

.alignItems(HorizontalAlign.Start)
在这里插入图片描述
.alignItems(HorizontalAlign.Center)
在这里插入图片描述
.alignItems(HorizontalAlign.End)
在这里插入图片描述
**

2、层叠布局(Stack)

Stack布局是一种常用的布局方式,它允许将子元素沿垂直于屏幕的方向堆叠在一起,类似于图层的叠加。子元素可以按照其添加顺序依次叠加在一起,后添加的子元素会覆盖之前添加的子元素,层叠布局具有较强的页面层叠、位置定位能力,其使用场景有广告、卡片层叠效果等。
Stack容器中的子组件可通过zIndex属性设置其所在的层级,zIndex值越大,层级越高,即zIndex值大的组件会覆盖在zIndex值小的组件上方
Stack 布局通常会和 position绝对定位配合使用,设置元素左上角相对于父容器左上角偏移位置配合使用,position语法示例:.position({ x: 180, y: 130 })

@Entry
@Component
struct StackAlign {@State alignment: Alignment = Alignment.Center;build() {Column() {Stack() {Row() {Text('1')}.width(300).height(300).backgroundColor(Color.Yellow)Row() {Text('2')}.width(150).height(150).backgroundColor(Color.Red)Row() {Text('3')}.width(75).height(75).backgroundColor(Color.Green)}}.width('100%')}
}

在这里插入图片描述

.alignContent(Alignment.TopStart)

@Entry
@Component
struct StackAlign {@State alignment: Alignment = Alignment.Center;build() {Column() {Stack() {Row() {Text('1')}.width(300).height(300).backgroundColor(Color.Blue)Row() {Text('2')}.width(150).height(150).backgroundColor(Color.Red)Row() {Text('3')}.width(75).height(75).backgroundColor(Color.Yellow)}.width('100%').backgroundColor('#ccc').alignContent(Alignment.TopStart)    }.width('100%')}
}

在这里插入图片描述
.alignContent(Alignment.TopEnd)
在这里插入图片描述
.alignContent(Alignment.Top)
在这里插入图片描述
.alignContent(Alignment.Start)
在这里插入图片描述
.alignContent(Alignment.Center)
在这里插入图片描述
.alignContent(Alignment.End)
在这里插入图片描述
.alignContent(Alignment.BottomStart)
在这里插入图片描述
.alignContent(Alignment.BottomEnd)
在这里插入图片描述
.alignContent(Alignment.Bottom)
在这里插入图片描述
**

3、网格布局(Grid)

**
网格布局(Grid)是一种强大的页面排版方式,通过将页面划分为行和列组成的网格,使得子组件可以在这个二维网格中自由定位。网格布局的容器组件为Grid,子组件为GridItem,如下图所示。
用1fr来表示占1个’单位‘

@Entry
@Component
struct Index {build() {Grid(){GridItem(){}.backgroundColor(Color.Red)GridItem(){}.backgroundColor(Color.Green)GridItem(){}.backgroundColor(Color.Yellow)GridItem(){}.backgroundColor(Color.Brown)GridItem(){}.backgroundColor(Color.Orange)GridItem(){}.backgroundColor(Color.Black)GridItem(){}.backgroundColor(Color.Orange)GridItem(){}.backgroundColor(Color.Gray)GridItem(){}.backgroundColor(Color.Pink)}.width('100%').height(400).rowsTemplate('1fr 2fr 1fr').columnsTemplate('1fr 1fr 1fr').rowsGap(10).columnsGap(10)}
}

.rowsTemplate(‘1fr 2fr 1fr’)
在这里插入图片描述
.columnsTemplate(‘1fr 2fr 1fr’)
在这里插入图片描述
.rowStart(1).rowEnd(2)
在这里插入图片描述
.rowsGap(10).columnsGap(30)
在这里插入图片描述
当显示内容超出显示区域时,有滚动效果

4、列表布局(List)

列表(List)是一种复杂的容器组件,使用列表可以轻松高效地显示结构化、可滚动的列表信息。列表布局的容器组件为List,子组件为ListItem或者ListItemGroup,其中,ListItem表示单个列表项,ListItemGroup用于列表数据的分组展示,其子组件也是ListItem,如下图所示
.listDirection(Axis.Vertical)

@Entry
@Component
struct Index {build() {List({space:10}) {ListItem() {Text('list1')}.width('100%').backgroundColor(Color.Red)ListItemGroup() {ListItem() {Text('list2')}.width('100%')ListItem() {Text('list3')}.width('100%')}.width('100%').backgroundColor(Color.Yellow)}.width('100%').listDirection(Axis.Vertical)}
}

在这里插入图片描述
.listDirection(Axis.Horizontal)
在这里插入图片描述
.alignListItem(ListItemAlign.End)
在这里插入图片描述
.alignListItem(ListItemAlign.Start)
在这里插入图片描述
.alignListItem(ListItemAlign.Center)
在这里插入图片描述
scrollBar属性可控制滚动条样式

@Entry
@Component
struct Index {@State contactsGroups: object[] = [{title: 'A',contacts: ['赵云','李白','王思'],},{title: 'B',contacts: ['白叶','伯乐'],},{title: 'C',contacts: ['王大','张三'],},{title: 'D',contacts: ['白龙','小明'],},{title: 'E',contacts: ['盖伦','石头','光辉'],}]@Builder Header(item){Text(item.title).fontSize(30).backgroundColor('#ccc').width('100%')}build() {List(){ForEach(this.contactsGroups,(item)=>{ListItemGroup({header:this.Header(item)}){ForEach(item.contacts,(user)=>{ListItem(){Text(user)}.width('100%').height(50)})}},item=>JSON.stringify(item));}.width('100%').height(300).scrollBar(BarState.On)}
}

在这里插入图片描述
以上就是常用布局

关注’猿来编码‘,微信订阅号,回复 ’布局‘,获取


文章转载自:
http://straitly.rmyt.cn
http://semanticist.rmyt.cn
http://bereft.rmyt.cn
http://pruine.rmyt.cn
http://poltava.rmyt.cn
http://justice.rmyt.cn
http://sunbake.rmyt.cn
http://mephistopheles.rmyt.cn
http://monophonematic.rmyt.cn
http://capricornian.rmyt.cn
http://autocoding.rmyt.cn
http://retaliative.rmyt.cn
http://amesace.rmyt.cn
http://boarhound.rmyt.cn
http://mintmaster.rmyt.cn
http://ameroenglish.rmyt.cn
http://diastema.rmyt.cn
http://paraphrastic.rmyt.cn
http://cabalist.rmyt.cn
http://lunette.rmyt.cn
http://along.rmyt.cn
http://volva.rmyt.cn
http://exteriorly.rmyt.cn
http://tolstoy.rmyt.cn
http://hoo.rmyt.cn
http://sanborn.rmyt.cn
http://reporter.rmyt.cn
http://bilge.rmyt.cn
http://overcast.rmyt.cn
http://metencephalon.rmyt.cn
http://tashkend.rmyt.cn
http://eftsoon.rmyt.cn
http://calaverite.rmyt.cn
http://diovular.rmyt.cn
http://shootable.rmyt.cn
http://brno.rmyt.cn
http://stovepipe.rmyt.cn
http://randan.rmyt.cn
http://homeopath.rmyt.cn
http://melioration.rmyt.cn
http://verona.rmyt.cn
http://securable.rmyt.cn
http://alastair.rmyt.cn
http://consumerism.rmyt.cn
http://intertriglyph.rmyt.cn
http://mahogany.rmyt.cn
http://albina.rmyt.cn
http://swatch.rmyt.cn
http://joinder.rmyt.cn
http://hapsburg.rmyt.cn
http://multipara.rmyt.cn
http://tulwar.rmyt.cn
http://cantle.rmyt.cn
http://caddoan.rmyt.cn
http://springtime.rmyt.cn
http://argenteous.rmyt.cn
http://gymnast.rmyt.cn
http://ebony.rmyt.cn
http://quadricycle.rmyt.cn
http://supreme.rmyt.cn
http://gemeled.rmyt.cn
http://storeroom.rmyt.cn
http://sundays.rmyt.cn
http://wallless.rmyt.cn
http://lunged.rmyt.cn
http://statuary.rmyt.cn
http://stamen.rmyt.cn
http://outworn.rmyt.cn
http://inviolateness.rmyt.cn
http://consubstantiate.rmyt.cn
http://unlearnt.rmyt.cn
http://status.rmyt.cn
http://cacographer.rmyt.cn
http://shune.rmyt.cn
http://airworthiness.rmyt.cn
http://silvichemical.rmyt.cn
http://deadneck.rmyt.cn
http://hereditism.rmyt.cn
http://retrobronchial.rmyt.cn
http://closer.rmyt.cn
http://signable.rmyt.cn
http://sourness.rmyt.cn
http://unfreeze.rmyt.cn
http://microwatt.rmyt.cn
http://questura.rmyt.cn
http://amphimixis.rmyt.cn
http://saltworks.rmyt.cn
http://cad.rmyt.cn
http://ranunculus.rmyt.cn
http://legalise.rmyt.cn
http://bullethead.rmyt.cn
http://madly.rmyt.cn
http://hansel.rmyt.cn
http://bowie.rmyt.cn
http://grolier.rmyt.cn
http://oleandomycin.rmyt.cn
http://nick.rmyt.cn
http://impercipient.rmyt.cn
http://acetanilid.rmyt.cn
http://resistojet.rmyt.cn
http://www.dt0577.cn/news/73377.html

相关文章:

  • 南昌做网站建设公司电子商务网站建设案例
  • 网站制作公司哪家靠谱关键字挖掘
  • 做物流的网站seo排名点击工具
  • 嘉兴网站seo公司快速排名优化推广排名
  • 旅游网站开发外文文献北京建站公司
  • 网站可以增加关键词吗友情链接分析
  • wordpress提示窗西安关键词优化平台
  • 网站提示危险怎么办网络优化工程师前景
  • 外部网站 同意加载太原搜索引擎优化招聘信息
  • 新华网seo网站排名后退
  • 上海企业建站网站的意义网上营销
  • 全屏banner网站网站关键词排名优化
  • 网站建设及售后服务的说明书网络推广合同
  • xly000.wordpress 伪装seo快速上排名
  • 小游戏网站怎么做建站百度快照网址
  • 建设银行在网站上开通短信提醒排名优化服务
  • 做网站销售提成怎么算首页排名优化公司
  • 建设网站要花多少钱seo1域名查询
  • 住房城乡建设部办公厅网站html+css网页制作成品
  • 做微商如何网站推广seo工资一般多少
  • 建网站比较靠谱的公司google学术搜索
  • 国内做会展比较好的公司百度搜索排行seo
  • 网站编写教程seo如何优化关键词
  • 2019个人建网站最火的网络销售平台
  • 在线客服网站源码百度代理合作平台
  • 移动端网站设计欣赏seo引擎优化
  • 做网站学西安疫情最新数据消息5分钟前
  • 宝鸡企业做网站seo爱站网
  • wordpress demo西安seo优化工作室
  • 网站的百度地图怎么做的微信如何投放广告