我试图使用label
控件在一页上显示近300行,但是我只显示第一行,我在使用以下代码,我如何显示所有行,是否label
是合适的控件?
Label testt = new Label { Text = MainPage.part1, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, FontAttributes = FontAttributes.Bold, FontSize = 24, TextColor = Color.White };
StackLayout stacklayout = new StackLayout
{
Children = {
TitleOfBook,
testt
}
};
ScrollView scroll = new ScrollView
{
Content = stacklayout
,VerticalOptions=LayoutOptions.FillAndExpand,
HorizontalOptions=LayoutOptions.FillAndExpand
};
Content = scroll;
不久前,我遇到了类似的问题。我认为问题在于标签的上限为100行(或类似的限制)。您可以创建一个自定义标签并将行限制设置为更高。
这是指向Xamarin论坛主题的链接,该链接可能会让您了解实现的想法。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句