为什么 Xamarin.forms 上的标签不显示所有文本?
why Label on Xamarin.forms does not display all text?
我试图使用 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 Forum 主题的 link,可能会给您一些实现的想法。
我试图使用 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 Forum 主题的 link,可能会给您一些实现的想法。