Bug 55023 - ScrollView with a Label cut bottom text on Android
Summary: ScrollView with a Label cut bottom text on Android
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.4
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 60077 ()
Depends on:
Blocks:
 
Reported: 2017-04-11 12:19 UTC by rr
Modified: 2017-12-20 14:54 UTC (History)
12 users (show)

Tags: xamarin.forms, ScrollView, label, android, ac
Is this bug a regression?: ---
Last known good build:


Attachments
Sample Project (188.52 KB, application/zip)
2017-04-11 12:29 UTC, rr
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 55023 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description rr 2017-04-11 12:19:26 UTC
When using a Label in a ScrollView with a very long text, ex: an eula, the ScrollView cut off the buttom text.
The problem is on Androind not on iOS. 

started in xamarin forum: https://forums.xamarin.com/discussion/92792/scrollview-with-a-label-cut-bottom-text-on-android-vertical-mode

Steps to reproduce:
Download and open Attachment.
run on android. 
the very last line off text should be "this is the end!!!".

My setup:
phone: Nexux 5x
android: 7.1.1

Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586
Installed Version: Professional

Xamarin   4.4.0.34 (3f99c5a)
Xamarin.Android   7.2.0.7 (b16fb82)
Xamarin.iOS   10.8.0.174 (7656cc6)
Xamarin.forms 2.3.4
Comment 1 rr 2017-04-11 12:26:36 UTC
Sample Project is 60mb zipped. too large for bugzilla
https://drive.google.com/open?id=0B5Z_FjzTbvLXS3pWdlFhM3p5NmM
Comment 2 rr 2017-04-11 12:29:21 UTC
Created attachment 21434 [details]
Sample Project
Comment 3 rr 2017-04-11 12:32:25 UTC
Aaaaand i am an idiot and zipped all the nuget with the project. 
the sample project is Attached now.
Comment 4 Jimmy [MSFT] 2017-04-11 15:29:12 UTC
Thank you for filing this report! Let me test with the project you attached to see if I can confirm the issue and I will update the report with my results.
Comment 5 rr 2017-05-05 09:48:45 UTC
@Jimmy Garrido 
Culd you confirm the bug?
Comment 6 Jimmy [MSFT] 2017-05-05 18:48:24 UTC
I am able to reproduce the issue described when running the attached project. It also works on UWP so this is only affecting Android. I am confirming this report so the team can investigate further.

### Version Tests
2.3.6.94    BAD
2.3.5-pre2  BAD
2.3.4.231   BAD
Comment 7 Luca V. 2017-06-08 08:50:38 UTC
Are there any news? Is it possible to know when a fix will be released?
Comment 8 John Hardman 2017-07-24 09:35:11 UTC
Just in case it's of any use, I created a repro sample before finding that this bug had already been reported. Repro sample below.

The text in this is 5000 characters long, but only the first 2500 are displayed.

If using this sample, just PushAsync an instance of LabelLengthBugOnAndroidPageView


using Xamarin.Forms;

namespace ViewsUsingXamarinForms
{
    public class LabelLengthBugOnAndroidPageView : ContentPage
    {
        public LabelLengthBugOnAndroidPageView()
        {
            string textToDisplay
                = " 1 - 78901234567890123456789012345678901234567890\r\n"
                + " 2 - 78901234567890123456789012345678901234567890\r\n"
                + " 3 - 78901234567890123456789012345678901234567890\r\n"
                + " 4 - 78901234567890123456789012345678901234567890\r\n"
                + " 5 - 78901234567890123456789012345678901234567890\r\n"
                + " 6 - 78901234567890123456789012345678901234567890\r\n"
                + " 7 - 78901234567890123456789012345678901234567890\r\n"
                + " 8 - 78901234567890123456789012345678901234567890\r\n"
                + " 9 - 78901234567890123456789012345678901234567890\r\n"
                + "10 - 78901234567890123456789012345678901234567890\r\n"
                + "11 - 78901234567890123456789012345678901234567890\r\n"
                + "12 - 78901234567890123456789012345678901234567890\r\n"
                + "13 - 78901234567890123456789012345678901234567890\r\n"
                + "14 - 78901234567890123456789012345678901234567890\r\n"
                + "15 - 78901234567890123456789012345678901234567890\r\n"
                + "16 - 78901234567890123456789012345678901234567890\r\n"
                + "17 - 78901234567890123456789012345678901234567890\r\n"
                + "18 - 78901234567890123456789012345678901234567890\r\n"
                + "19 - 78901234567890123456789012345678901234567890\r\n"
                + "20 - 78901234567890123456789012345678901234567890\r\n"
                + "21 - 78901234567890123456789012345678901234567890\r\n"
                + "22 - 78901234567890123456789012345678901234567890\r\n"
                + "23 - 78901234567890123456789012345678901234567890\r\n"
                + "24 - 78901234567890123456789012345678901234567890\r\n"
                + "25 - 78901234567890123456789012345678901234567890\r\n"
                + "26 - 78901234567890123456789012345678901234567890\r\n"
                + "27 - 78901234567890123456789012345678901234567890\r\n"
                + "28 - 78901234567890123456789012345678901234567890\r\n"
                + "29 - 78901234567890123456789012345678901234567890\r\n"
                + "30 - 78901234567890123456789012345678901234567890\r\n"
                + "31 - 78901234567890123456789012345678901234567890\r\n"
                + "32 - 78901234567890123456789012345678901234567890\r\n"
                + "33 - 78901234567890123456789012345678901234567890\r\n"
                + "34 - 78901234567890123456789012345678901234567890\r\n"
                + "35 - 78901234567890123456789012345678901234567890\r\n"
                + "36 - 78901234567890123456789012345678901234567890\r\n"
                + "37 - 78901234567890123456789012345678901234567890\r\n"
                + "38 - 78901234567890123456789012345678901234567890\r\n"
                + "39 - 78901234567890123456789012345678901234567890\r\n"
                + "40 - 78901234567890123456789012345678901234567890\r\n"
                + "41 - 78901234567890123456789012345678901234567890\r\n"
                + "42 - 78901234567890123456789012345678901234567890\r\n"
                + "43 - 78901234567890123456789012345678901234567890\r\n"
                + "44 - 78901234567890123456789012345678901234567890\r\n"
                + "45 - 78901234567890123456789012345678901234567890\r\n"
                + "46 - 78901234567890123456789012345678901234567890\r\n"
                + "47 - 78901234567890123456789012345678901234567890\r\n"
                + "48 - 78901234567890123456789012345678901234567890\r\n"
                + "49 - 78901234567890123456789012345678901234567890\r\n"
                + "50 - 78901234567890123456789012345678901234567890\r\n"
                + "51 - 78901234567890123456789012345678901234567890\r\n"
                + "52 - 78901234567890123456789012345678901234567890\r\n"
                + "53 - 78901234567890123456789012345678901234567890\r\n"
                + "54 - 78901234567890123456789012345678901234567890\r\n"
                + "55 - 78901234567890123456789012345678901234567890\r\n"
                + "56 - 78901234567890123456789012345678901234567890\r\n"
                + "57 - 78901234567890123456789012345678901234567890\r\n"
                + "58 - 78901234567890123456789012345678901234567890\r\n"
                + "59 - 78901234567890123456789012345678901234567890\r\n"
                + "60 - 78901234567890123456789012345678901234567890\r\n"
                + "61 - 78901234567890123456789012345678901234567890\r\n"
                + "62 - 78901234567890123456789012345678901234567890\r\n"
                + "63 - 78901234567890123456789012345678901234567890\r\n"
                + "64 - 78901234567890123456789012345678901234567890\r\n"
                + "65 - 78901234567890123456789012345678901234567890\r\n"
                + "66 - 78901234567890123456789012345678901234567890\r\n"
                + "67 - 78901234567890123456789012345678901234567890\r\n"
                + "68 - 78901234567890123456789012345678901234567890\r\n"
                + "69 - 78901234567890123456789012345678901234567890\r\n"
                + "70 - 78901234567890123456789012345678901234567890\r\n"
                + "71 - 78901234567890123456789012345678901234567890\r\n"
                + "72 - 78901234567890123456789012345678901234567890\r\n"
                + "73 - 78901234567890123456789012345678901234567890\r\n"
                + "74 - 78901234567890123456789012345678901234567890\r\n"
                + "75 - 78901234567890123456789012345678901234567890\r\n"
                + "76 - 78901234567890123456789012345678901234567890\r\n"
                + "77 - 78901234567890123456789012345678901234567890\r\n"
                + "78 - 78901234567890123456789012345678901234567890\r\n"
                + "79 - 78901234567890123456789012345678901234567890\r\n"
                + "80 - 78901234567890123456789012345678901234567890\r\n"
                + "81 - 78901234567890123456789012345678901234567890\r\n"
                + "82 - 78901234567890123456789012345678901234567890\r\n"
                + "83 - 78901234567890123456789012345678901234567890\r\n"
                + "84 - 78901234567890123456789012345678901234567890\r\n"
                + "85 - 78901234567890123456789012345678901234567890\r\n"
                + "86 - 78901234567890123456789012345678901234567890\r\n"
                + "87 - 78901234567890123456789012345678901234567890\r\n"
                + "88 - 78901234567890123456789012345678901234567890\r\n"
                + "89 - 78901234567890123456789012345678901234567890\r\n"
                + "90 - 78901234567890123456789012345678901234567890\r\n"
                + "91 - 78901234567890123456789012345678901234567890\r\n"
                + "92 - 78901234567890123456789012345678901234567890\r\n"
                + "93 - 78901234567890123456789012345678901234567890\r\n"
                + "94 - 78901234567890123456789012345678901234567890\r\n"
                + "95 - 78901234567890123456789012345678901234567890\r\n"
                + "96 - 78901234567890123456789012345678901234567890\r\n"
                + "97 - 78901234567890123456789012345678901234567890\r\n"
                + "98 - 78901234567890123456789012345678901234567890\r\n"
                + "99 - 78901234567890123456789012345678901234567890\r\n"
                + "===";

            Label labelTask = new Label
            {
                Text = textToDisplay,
                LineBreakMode = LineBreakMode.WordWrap,
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                BackgroundColor = Color.White,
                TextColor = Color.Black
            };

            StackLayout vslPage = new StackLayout
            {
                BackgroundColor = Color.Gray,
                Orientation = StackOrientation.Vertical,
                VerticalOptions = LayoutOptions.Start,
                Children =
                {
                    labelTask
                }
            };

            ScrollView scrollView = new ScrollView
            {
                BackgroundColor = Color.White,
                Orientation = ScrollOrientation.Vertical,
                Content = vslPage   
            };

            this.Content = scrollView;
        }
    }
}

// eof
Comment 9 Bo Kingo Damgaard 2017-08-14 10:03:23 UTC
I think it's due to this:
https://github.com/xamarin/Xamarin.Forms/blob/5642dd58cda563ec6328495567a5505e24e392f3/Xamarin.Forms.Platform.Android/Renderers/LabelRenderer.cs#L170

Someone decided that 100 lines of text is enough :)
Comment 10 rr 2017-09-05 11:48:52 UTC
workaround using a cus. renderer:

public class VeryLargeTextLabelRenderer : LabelRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
        {
            base.OnElementChanged(e);

            Control?.SetMaxLines(int.MaxValue);
        }
    }
Comment 11 Atsushi Eno 2017-09-24 18:10:56 UTC
I heard of the same problem, and the local reporter was kind enough to offer a repro here. https://bugzilla.xamarin.com/show_bug.cgi?id=55023 (via https://twitter.com/yuki2006_kd/status/912012838373224448)
Comment 12 Paul DiPietro [MSFT] 2017-10-13 16:48:18 UTC
*** Bug 60077 has been marked as a duplicate of this bug. ***
Comment 13 Justin 2017-12-20 14:54:57 UTC
Just curious if this bug is going to be resolved anytime soon?