[英]How can I make a ContentPage with a StackLayout inside scrollable?
Here is the code I have: 这是我的代码:
<ContentPage>
<ContentPage.Content>
<StackLayout Spacing="10" Margin="20">
<Label />
<Label />
<Label />
.....
<Label />
<Label />
</StackLayout>
</ContentPage.Content>
</ContentPage>
There are a large number of labels, so many that they go off the end of the screen. 有很多标签,很多标签都会脱离屏幕的最后。 But the screen won't scroll.
但屏幕不会滚动。 How can I make it scrollable?
如何使其可滚动?
<ContentPage.Content>
<ScrollView>
<StackLayout>
<Label />
<Label />
<Label />
<Entry />
</StackLayout>
</ScrollView>
</ContentPage.Content>
If you only have Labels and they are pretty simple, why not use a ListView which has implicit scrolling? 如果你只有标签并且它们非常简单,为什么不使用具有隐式滚动的ListView? Otherwise Cole Xia is correct, wrap in a ScrollView
否则Cole Xia是正确的,包装在ScrollView中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.