Bug 33841 - On iOS, Label with StartAndExpand HorizontalOptions does not expand if multiline (word wrap)
Summary: On iOS, Label with StartAndExpand HorizontalOptions does not expand if multil...
Status: RESOLVED DUPLICATE of bug 28650
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.5.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-09-10 04:44 UTC by Thibault Durand
Modified: 2016-11-15 02:54 UTC (History)
7 users (show)

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

Zipped simple Xforms project to show the bug. (334.57 KB, application/zip)
2015-09-10 04:44 UTC, Thibault Durand

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:

Description Thibault Durand 2015-09-10 04:44:20 UTC
Created attachment 12847 [details]
Zipped simple Xforms project to show the bug.

*** Overview ***

When adding a left-aligned Label (LayoutOptions.StartAndExpand) and a right-aligned Switch (LayoutOptions.End) to an horizontal StackLayout: 
This works well in all cases on Android but on iOS the label does not expand any more when the text contains line breaks due to word wrapping.
In the attached zip file you can find a simple sample project using Xamarin.Forms as well as a PNG image illustrating the issue. 
I have tested the issue with the following versions: 
All versions are affected in the same way. 

This could be a duplicate of #28650 or #31128

*** Steps to Reproduce ***

1. Start the attached sample app on iPhone simulator 5S or 6. 

*** Environment Info ***

Xamarin Studio
Version 5.9.5 (build 9)
Installation UUID: b3819a7b-8a99-45e7-a65c-7d612aaa73f1
	Mono 4.0.3 ((detached/d6946b4)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400030020

Apple Developer Tools
Xcode 6.4 (7720)
Build 6E35b

Version: (Business Edition)
Hash: 2c66d2f
Branch: master
Build date: 2015-08-04 13:52:25-0400

Version: (Business Edition)
Android SDK: /Users/thidu06/Library/Android/sdk/
	Supported Android versions:
		4.1 (API level 16)
		4.2 (API level 17)
		5.0 (API level 21)
		5.1 (API level 22)
Java SDK: /usr
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Xamarin Android Player
Not Installed

Version: (Starter Edition)

Build Information
Release ID: 509050009
Git revision: b99cb19a1d3b15d8980c4616f13f837457e5b292
Build date: 2015-07-28 02:01:44-04
Xamarin addins: d53d6eceb828422f3d4aff8547f2f6bab6c9ea58

Operating System
Mac OS X 10.10.5
Darwin dhcp-16-23.it.liu.se 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 1 E.Z. Hart [MSFT] 2016-04-13 18:55:59 UTC
Still occurring in, still happens with "LayoutOptions.FillAndExpand"
Comment 2 Falko Schindler 2016-06-29 08:19:11 UTC
Same here with Very annoying.
Does anyone know a reliable workaround?
Comment 3 Falko Schindler 2016-06-29 08:23:04 UTC
Just because I've created it for myself anyway, here is a more compact test page:

    MainPage = new ContentPage {
        Content = new StackLayout {
            Orientation = StackOrientation.Horizontal,
            VerticalOptions = LayoutOptions.CenterAndExpand,
            BackgroundColor = Color.Yellow,
            Children = {
                new Label {
                    Text = "This simple dummy label contains extraordinarily many words.",
                    BackgroundColor = Color.Silver,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                new Label {
                    Text = "!",
                    BackgroundColor = Color.Silver,

The dummy text is somehow tuned to overstate the case on the small screen of an iPhone 4s.
Comment 4 Thibault Durand 2016-06-29 08:25:54 UTC
You can probably use a Grid instead of StackLayout as proposed by James Montemagno here: 

At least it did solve it for me. 

Comment 5 Thibault Durand 2016-06-29 08:26:47 UTC
Permalink to forum should have been: 
Comment 6 Falko Schindler 2016-06-29 08:31:11 UTC
Thanks! I'll try the Grid approach. :)

I used to hack around this problem with

    WidthRequest = 1e10;

But it possibly messes with other views that request a certain width.
Comment 7 Ray Kelly 2016-07-16 14:42:27 UTC
Can we please get this fixed?  Grid does not work when its in a ListView with UnevenRows (another bug that is logged).  Thank you.
Comment 8 Paul DiPietro [MSFT] 2016-11-15 02:54:05 UTC

*** This bug has been marked as a duplicate of bug 28650 ***