Bug 55965 - Size for label with rotation not calculated correctly
Summary: Size for label with rotation not calculated correctly
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-05-04 14:12 UTC by Saskia
Modified: 2017-12-09 11:15 UTC (History)
4 users (show)

Tags: ac ios android uwp layout rotation size
Is this bug a regression?: ---
Last known good build:

Test app with vertical text problem (three test cases) (47.65 KB, application/x-zip-compressed)
2017-05-04 14:12 UTC, Saskia

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 55965 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:

Description Saskia 2017-05-04 14:12:26 UTC
Created attachment 21949 [details]
Test app with vertical text problem (three test cases)

When I use a label with rotation = 90, the size of the label is calculated before rotating the text. The label therefor needs too much space.

For instance, I have a grid with 2 columns. The first columns should use all the space available. The second column holds the label with vertical text and should take as little width as possible.
The width of the second column is calculated to hold the text without rotation and is therefor too big.

In the attached sample project I have added three test cases:
 - grid with only labels added;
 - grid with the label with vertical text added to a stacklayout;
 - stacklayout with the labels.

I have previously tried all kinds of layouts and variations. None works.
A 'workaround' I have found was to set the width of the second column to a fixed value. Problem with that is that the text is not always shown, but the column will still take the space. And of course, this workaround is not device independent.
Comment 1 Jimmy [MSFT] 2017-05-08 18:58:46 UTC
Thank you for filing this report! Let me run the project you attached to verify that I can reproduce the issue and I will update the report again with my results.
Comment 2 Jimmy [MSFT] 2017-06-23 16:25:59 UTC
I was able to reproduce this issue with the project provided. This also happens on iOS so I believe this is a general layout issue so I image UWP is also affected though I did not test on that platform. 

As mentioned, the Label is maintaining its original size even after rotation. However it's unclear whether or not this is intended behavior when transforming elements. I will confirm this report so the engineers can investigate further and provide feedback. Thanks!

### Version Tests
2.3.5-pre5  BAD   BAD