【发布时间】:2019-02-07 23:34:58
【问题描述】:
我正在使用 Nativescript-vue 构建我的第一个 Nativescript 应用程序,但我在页面布局方面遇到了问题。
文档向您展示了如何布局页面,但总体使用情况不太清楚,我看不出您是否可以在每个页面上使用多个布局样式
我想开始在页面顶部使用 stacklayout,然后在表格中显示一些数据,所以我在下部使用网格布局。
我发现当我使用多个布局时,它只显示页面上的最后一个布局
示例:(页面上只显示GridLayout部分,stacklayout不可见)
<template>
<Page class="page">
<ActionBar class="action-bar" :title="title"/>
<ScrollView>
<StackLayout>
<Image :src="img" stretch="aspectFit" v-if="img" />
<Button class="btn btn-primary" text="Buy Now" @tap="visitPage(url)" v-if="url" />
</StackLayout>
<GridLayout columns="auto, auto" rows="2*, 3*">
<Label text="Author:" row="0" col="0" padding="20px" />
<Label text="Shakespear" row="0" col="1" padding="20px" />
<Label text="Publisher" row="1" col="0" padding="20px" />
<Label text="A publisher" row="1" col="1" padding="20px" />
</GridLayout>
</ScrollView>
</Page>
</template>
问:有没有办法在每页显示多个布局选项?
【问题讨论】:
标签: nativescript nativescript-vue