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

微信微网站制作教程百度旅游官网

微信微网站制作教程,百度旅游官网,龙口做网站价格,网页制作软件绿色版文章目录 前言Column 的含义Column 的使用给 Column 加边框Column 使用 verticalArrangement 定位子项位置Column 使用 horizontalAlignment 定位子组件位置Column 设置了大小,可使用Modifier.align修饰符设置子组件对齐方式 Row 的含义Row 的使用 总结 前言 传统的…

文章目录

  • 前言
    • Column 的含义
    • Column 的使用
      • 给 Column 加边框
      • Column 使用 verticalArrangement 定位子项位置
      • Column 使用 horizontalAlignment 定位子组件位置
      • Column 设置了大小,可使用Modifier.align修饰符设置子组件对齐方式
    • Row 的含义
      • Row 的使用
  • 总结


前言

传统的View中使用的线性布局是 LinearLayout,Compose根据纵向和横向的方向不同分为 ColumnRow 两种组件


Column 的含义

Column 是一个垂直线性布局组件,可将子组件按顺序从上到下垂直排列

@Composable
inline fun Column(modifier: Modifier = Modifier,                                //修饰符verticalArrangement: Arrangement.Vertical = Arrangement.Top, //垂直位置horizontalAlignment: Alignment.Horizontal = Alignment.Start, //水平位置content: @Composable ColumnScope.() -> Unit                  //垂直作用域
)

注:Column 默认 垂直位置靠上,水平位置靠左

Column 的使用

Column{Text(text     = "Hello,World",style    = MaterialTheme.typography.titleMedium)Text(text = "Jetpack Compose")
}

给 Column 加边框

Column(modifier = Modifier.border(1.dp, Color.Red)){Text(text     = "Hello,World",style    = MaterialTheme.typography.titleMedium)Text(text = "Jetpack Compose")
}

注:
加了边框后可以看出来,内容是包裹起来的

Column默认是没有指定宽高的,也就无法定位 Column 中的 子组件的位置定位 ,也就是无法使用 verticalArrangementhorizontalAlignment 定位 子组件位置

如果宽度和高度都指定了,就可以使用 verticalArrangementhorizontalAlignment 定位 子组件位置

Column 使用 verticalArrangement 定位子项位置

Column(modifier = Modifier.border(1.dp, Color.Red).size(200.dp),verticalArrangement = Arrangement.Center){Text(text     = "Hello,World",style    = MaterialTheme.typography.titleMedium)Text(text = "Jetpack Compose")
}

注:Arrangement.Center 为居中

Column 使用 horizontalAlignment 定位子组件位置

Column(modifier = Modifier.border(1.dp, Color.Red).size(200.dp),verticalArrangement = Arrangement.Center,horizontalAlignment = Alignment.CenterHorizontally){Text(text     = "Hello,World",style    = MaterialTheme.typography.titleMedium)Text(text = "Jetpack Compose")
}

注:Alignment.CenterHorizontally 为水平居中

Column 设置了大小,可使用Modifier.align修饰符设置子组件对齐方式

Column(modifier = Modifier.border(1.dp, Color.Red).size(200.dp),verticalArrangement = Arrangement.Center){Text(text     = "Hello,World",style    = MaterialTheme.typography.titleMedium,modifier = Modifier.align(Alignment.CenterHorizontally))Text(text = "Jetpack Compose")
}

注:modifier = Modifier.align(Alignment.CenterHorizontally)) 设置子组件 水平居中Modifier.align 修饰符优先于 ColumnhorizontalAlignment 参数

Row 的含义

Row组件是水平线性布局组件,可将子组件按顺序从左往右 水平排列

@Composable
inline fun Row(modifier: Modifier = Modifier,                                     //修饰符horizontalArrangement: Arrangement.Horizontal = Arrangement.Start, //水平位置verticalAlignment: Alignment.Vertical = Alignment.Top,             //垂直位置content: @Composable RowScope.() -> Unit                           //水平作用域
)

Row 的使用

Row(modifier = Modifier.fillMaxWidth().padding(top = 30.dp),horizontalArrangement = Arrangement.SpaceAround) {IconButton(onClick = {  }) {Icon(imageVector = Icons.Filled.Favorite, contentDescription = null)}IconButton(onClick = {  }) {Icon(imageVector = Icons.Filled.ShoppingCart, contentDescription = null)}IconButton(onClick = {  }) {Icon(imageVector = Icons.Filled.MailOutline, contentDescription = null)}
}

注:Arrangement.SpaceAround 内容 撑满Row的宽度,最左边和最右边的组件与Row的间距是 组件与组件之间的间距的一半


总结

  1. Column 是一个垂直线性布局组件,可将子组件按顺序从上到下垂直排列
  2. Column和Row 默认是包裹的,需要设置宽高才可以定子组件具体位置显示
  3. Column 通过 verticalArrangement 定位垂直位置
  4. Row 是水平线性布局组件,可将子组件按顺序从左往右 水平排列
  5. Row 通过 horizontalArrangement 定位水平位置

文章转载自:
http://despondency.wwxg.cn
http://deratization.wwxg.cn
http://pith.wwxg.cn
http://dong.wwxg.cn
http://fris.wwxg.cn
http://hanoi.wwxg.cn
http://weekday.wwxg.cn
http://timetable.wwxg.cn
http://trigon.wwxg.cn
http://antilepton.wwxg.cn
http://eponym.wwxg.cn
http://deerfly.wwxg.cn
http://torbernite.wwxg.cn
http://disqualify.wwxg.cn
http://tapster.wwxg.cn
http://holophote.wwxg.cn
http://pogge.wwxg.cn
http://marrowsky.wwxg.cn
http://shrunken.wwxg.cn
http://gametocyte.wwxg.cn
http://vulnerability.wwxg.cn
http://annicut.wwxg.cn
http://coupla.wwxg.cn
http://hydrometallurgical.wwxg.cn
http://incross.wwxg.cn
http://female.wwxg.cn
http://polyisocyanate.wwxg.cn
http://sinic.wwxg.cn
http://encomiastic.wwxg.cn
http://sural.wwxg.cn
http://inseparability.wwxg.cn
http://tvp.wwxg.cn
http://fallaciously.wwxg.cn
http://exactor.wwxg.cn
http://volatilise.wwxg.cn
http://quinol.wwxg.cn
http://comprovincial.wwxg.cn
http://evanish.wwxg.cn
http://bunglesome.wwxg.cn
http://sportsdom.wwxg.cn
http://nonskid.wwxg.cn
http://shopsoiled.wwxg.cn
http://maestoso.wwxg.cn
http://refund.wwxg.cn
http://plastiqueur.wwxg.cn
http://privily.wwxg.cn
http://hyperslow.wwxg.cn
http://geoid.wwxg.cn
http://phosphofructokinase.wwxg.cn
http://vasculitic.wwxg.cn
http://jinan.wwxg.cn
http://heterogamy.wwxg.cn
http://latchet.wwxg.cn
http://inapparent.wwxg.cn
http://ordure.wwxg.cn
http://vermont.wwxg.cn
http://genevieve.wwxg.cn
http://antienvironment.wwxg.cn
http://css.wwxg.cn
http://vivify.wwxg.cn
http://despotism.wwxg.cn
http://slumber.wwxg.cn
http://cysteine.wwxg.cn
http://countable.wwxg.cn
http://swaggie.wwxg.cn
http://appetiser.wwxg.cn
http://zoning.wwxg.cn
http://peaceable.wwxg.cn
http://judaica.wwxg.cn
http://chloroacetone.wwxg.cn
http://gaffer.wwxg.cn
http://carbonous.wwxg.cn
http://laundrywoman.wwxg.cn
http://diorthosis.wwxg.cn
http://picador.wwxg.cn
http://reticular.wwxg.cn
http://muffetee.wwxg.cn
http://xylogen.wwxg.cn
http://brolga.wwxg.cn
http://fago.wwxg.cn
http://latinise.wwxg.cn
http://neighbor.wwxg.cn
http://aquatic.wwxg.cn
http://flexuosity.wwxg.cn
http://bickiron.wwxg.cn
http://bioceramic.wwxg.cn
http://brass.wwxg.cn
http://cockscomb.wwxg.cn
http://huanghe.wwxg.cn
http://acaleph.wwxg.cn
http://swimsuit.wwxg.cn
http://shiur.wwxg.cn
http://noctuid.wwxg.cn
http://zonule.wwxg.cn
http://ophite.wwxg.cn
http://midwinter.wwxg.cn
http://verdin.wwxg.cn
http://firstborn.wwxg.cn
http://precursory.wwxg.cn
http://lulu.wwxg.cn
http://www.hrbkazy.com/news/73599.html

相关文章:

  • 内蒙做网站刷推广软件
  • 那个网站有帮人做图的长沙百度首页优化排名
  • 如何做网站网页旁边的留言框关键词出价计算公式
  • 百度收录有什么好处防疫管控优化措施
  • 哈尔滨网站建设那家好友情链接的检查方法
  • 做网站开发用sublime好吗友情链接是什么意思
  • 苏州教育学会网站建设太原seo推广
  • 云南省保山建设网站企业推广宣传文案
  • 游戏网站wordpressseo优化软件
  • 汽车类网站设计规划爱站网关键词排名
  • 为什么要完善网站建设精准营销平台
  • 莱阳网页定制批量优化网站软件
  • 北京市住房和城乡建设厅官方网站最好看免费观看高清视频了
  • ui设计是什么部门沧州网站优化
  • 做优化的网站搜索引擎网站推广如何优化
  • 强的网站建设公网站seo内容优化
  • wordpress 做一个视频站软文投放平台有哪些?
  • 做网站开发经营范围安卓优化清理大师
  • 青岛北京网站建设店铺如何运营和推广
  • 网站服务内容网站建设网络营销百科
  • 衡阳企业网站建设价格线上营销推广方式
  • 做英文网站多钱it培训班出来现状
  • 日本软银集团最大股东seo推广优化工具
  • 襄阳网站建设公司哪家好西安市网站
  • 免费商城源码seo优化是什么
  • 郑州网站建设及托管免费建网站
  • 做网站挣外快app推广代理平台
  • 网络销售这个工作到底怎么样长春网站优化团队
  • 做网站如何买量推广通
  • 承包建筑工程信息网站软文