帧布局(frame)

帧布局

帧布局(frame),所有子控件默认都放在左上角。

子控件属性-layoutGravity

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