Bug 31175 - ScrollView does not show all text
Summary: ScrollView does not show all text
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-06-16 17:57 UTC by Mark Fredrickson
Modified: 2015-06-18 05:16 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Text that is not fully shown in a ScrollView (13.28 KB, text/plain)
2015-06-16 17:57 UTC, Mark Fredrickson
Details
Sample project demonstrating the bug (183.02 KB, application/x-zip-compressed)
2015-06-17 09:37 UTC, Mark Fredrickson
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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Mark Fredrickson 2015-06-16 17:57:57 UTC
Created attachment 11631 [details]
Text that is not fully shown in a ScrollView

I have a label inside a ScrollView and the contents of the label is not fully shown. I tried different combinations of StackViews inside the ScrollView but to no avail. Code is below and my text file is attached. The EULAText.FormattedText is completely populated.


XAML:

  <ScrollView Orientation="Vertical" VerticalOptions="FillAndExpand">
    <Label x:Name="EULAText"/>
  </ScrollView>

Code:

   EULAText.FormattedText = Helper.GetAppFileStream("EULA_English.txt").ReadToEnd();
Comment 1 Mark Fredrickson 2015-06-16 18:26:07 UTC
This bug exist in both Forms version 1.4.3.6358-pre2 and 1.4.3.6364-pre3.
Comment 2 Rui Marinho 2015-06-16 19:25:35 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. What platform are you seeing the issue?

Warm regards,
Xamarin Forms Team
Comment 3 Rui Marinho 2015-06-16 19:36:16 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue we would very much appreciate it.

Warm regards,
Xamarin Forms Team
Comment 4 Jason Smith [MSFT] 2015-06-16 20:25:36 UTC
On top of that see if breaking the label out into labels which are < 5000 characters a piece resolves your issue. Some phones have hard limits baked into them for the max number of characters per label.
Comment 5 Mark Fredrickson 2015-06-17 09:37:33 UTC
Created attachment 11645 [details]
Sample project demonstrating the bug

I had to remove the packages, bin, and obj folders to get the size down to an acceptable size.
Comment 6 Mark Fredrickson 2015-06-17 09:39:44 UTC
I attached a sample project. The label does contain the full text so I don't think its a label size issue. I also tried two labels and it still only scrolled to the same point.
Comment 7 Mark Fredrickson 2015-06-17 09:56:01 UTC
Also, this is a conversion from my Xamarin.Android app and the EULA shows fine using ScrollView in an .axml file.
Comment 8 Rui Marinho 2015-06-17 12:30:36 UTC
Mark can you try Jason solution, here's how it can work for your EULA :

<ScrollView Orientation="Vertical" VerticalOptions="FillAndExpand">
  	<StackLayout>
  		<Label x:Name="EULAText"/>
  	 	<Label x:Name="EULAText1"/>
  	 	<Label x:Name="EULAText2"/>
  	 	<Label x:Name="EULAText3"/>
  	</StackLayout>
  </ScrollView>

>var text = GetAppFileStream ("EULA_English.txt").ReadToEnd ();
>var max = 4170;
>var index = 0;
>EULAText.FormattedText = text.Substring (index, max);
>index += max;
>EULAText1.FormattedText = text.Substring (index, max);
>index += max;
>EULAText2.FormattedText = text.Substring (index, max);
>index += max;
>EULAText3.FormattedText = text.Substring (index);
Comment 9 Mark Fredrickson 2015-06-17 18:13:41 UTC
This kinda works but the multiple labels causes line breaks in the middle of paragraphs so unfortunately it isn't an acceptable solution.

Any reason why the Xamarin.Android version works with one label and the Xamarin.Forms doesn't?
Comment 10 Mark Fredrickson 2015-06-17 20:01:34 UTC
With this solution I could split the EULA file into smaller files with natural line breaks.

However I was able to get WebView to work by playing around with VerticalOptions on the other controls I have on the EULA page so I'm good if you want to either still figure things out or just give it a miss.
Comment 11 Rui Marinho 2015-06-18 05:16:03 UTC
Thanks Mark.