帧布局(frame)

帧布局

帧布局(frame)是视图组(group)的子控件,可以自由设置子控件的位置,其所有子控件默认都放在左上角。

子控件布局属性-layoutGravity

子控件在布局中的位置,注意该属性用在frame的子控件中
  • left。靠左
  • right。靠右
  • top。靠顶部
  • bottom。靠底部
  • center。居中
  • center_vertical。垂直居中
  • center_horizontal。水平居中
<template> <frame orientation="horizontal"> <text text="控件" layoutGravity="top"/> <button text="确认" layoutGravity="bottom"/> </frame> </template>