模版(template)

模版介绍

模版(template)ui的根,也就是说所有ui控件只能在template内部

属性-fullscreen

属性fullscreen表示是否全屏显示,默认为false。例:
<template fullscreen="true">
    <text id="demo" text="hello"/>
</template>

function main() {
    setupUI();
}

属性-with

UI的宽,默认为wrap content效果。类型为float,如果取值范围为[0,1]表示比例,比如:0.5表示宽度的一半;大于1表示dp值,不是px值。在创建悬浮对话框时使用,其他情况不要用。例:
<template width="0.3">
    <text id="demo" text="hello"/>
</template>

function main() {
    setupUI();
}

属性-height

UI的高,默认为wrap content效果。类型为float,如果取值范围为[0,1]表示比例,比如:0.5表示高度的一半;大于1表示dp值,不是px值。在创建悬浮对话框时使用,其他情况不要用。例:
<template height="0.3">
    <text id="demo" text="hello"/>
</template>

function main() {
    setupUI();
}