簡體   English   中英

為什么Xamarin.forms上的Label不顯示所有文本?

[英]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論壇主題的鏈接,它可能使您有一個實現的想法。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM