如何使内部带有堆栈布局的内容页面可滚动?



这是我的代码:

<ContentPage>
<ContentPage.Content>
<StackLayout Spacing="10" Margin="20">
<Label /> 
<Label />
<Label />
.....
<Label />
<Label />
</StackLayout>
</ContentPage.Content>
</ContentPage>

有大量的标签,如此之多,以至于它们离开了屏幕的尽头。 但屏幕不会滚动。 如何使其可滚动?

<ContentPage.Content>
<ScrollView>
<StackLayout>
<Label /> 
<Label /> 
<Label /> 
<Entry />
</StackLayout>
</ScrollView>
</ContentPage.Content>

如果您只有标签并且它们非常简单,为什么不使用具有隐式滚动的 ListView?否则科尔夏是正确的,包裹在滚动视图中

最新更新