Nativescript 如何在保持滚动的同时垂直填充ScrollView中元素之间的空间
我正在努力实现以下目标: 我尝试通过GridLayout实现这一点,但只实现了以下两件事中的一件:Nativescript 如何在保持滚动的同时垂直填充ScrollView中元素之间的空间,nativescript,Nativescript,我正在努力实现以下目标: 我尝试通过GridLayout实现这一点,但只实现了以下两件事中的一件: 标签和StackLayout之间的空间已填充(标签为 拉伸),但在向中添加更多标签时,滚动将不起作用 堆栈布局 将更多标签添加到中时,滚动将起作用 StackLayout,但当仅显示一个标签时,例如 StackLayout之前的标签将不会拉伸 有没有办法实现这样的目标?GridLayout不一定需要,但我尝试了几种方法,但找不到任何方法 代码示例(1) 顶级标签 标签A 标签B (2)的示例
顶级标签
标签A
标签B
(2)的示例代码:
顶级标签
标签A
标签B
你的意思是,你的标签和堆栈布局之间需要空白吗?@Manoj Yess,这正是我的意思:)看着你的图像,我认为你应该在这里使用视差滚动。@Manoj你能指定如何建立它吗?例如,签出
<Page class="page dark">
<ScrollView backgroundColor="red">
<GridLayout rows="*, auto" height="100%" backgroundColor="blue">
<Label backgroundColor="green">Top Label</Label>
<StackLayout row="1" backgroundColor="green">
<Label backgroundColor="purple">Label A</Label>
<Label backgroundColor="purple">Label B</Label>
</StackLayout>
</GridLayout>
</ScrollView>
</Page>
<Page class="page dark">
<ScrollView backgroundColor="red">
<GridLayout rows="*, auto" backgroundColor="blue">
<Label backgroundColor="green">Top Label</Label>
<StackLayout row="1" backgroundColor="green">
<Label backgroundColor="purple">Label A</Label>
<Label backgroundColor="purple">Label B</Label>
</StackLayout>
</GridLayout>
</ScrollView>
</Page>