Bug 37614 - MinimumWidthRequest is ignored on Button in iOS
Summary: MinimumWidthRequest is ignored on Button in iOS
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.0.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-01-12 14:00 UTC by John Hardman
Modified: 2016-09-27 11:23 UTC (History)
3 users (show)

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

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 37614 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 John Hardman 2016-01-12 14:00:12 UTC
Using Xamarin.Forms, I create a Button containing a short piece of text, such as "on".
I specify a MinimumWidthRequest, but the Button on iOS is rendered with a Width less than the MinimumWidthRequest.

To reproduce, instantiate a ContentPage with the following instance variable, and method, then put the bottom piece of code in the constructor for the ContentPage. Build and run. Press the button that is displayed, and it's width will appear in the page title. The width on my devices shows 30, even though the MinimumWidthRequest is 44.

        // instance variable

        private Button _b;

        // method

        private void OnPress()
            this.Title = _b.Width.ToString();

        // in the ContentPage constructor, put the following lines:

            _b = new Button
                BackgroundColor = Color.Aqua,
                TextColor = Color.Black,
                Text = "on",
                MinimumWidthRequest = 44,
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions = LayoutOptions.Start,
                Command = new Command(OnPress)
            Content = _b;
Comment 1 adrianknight89 2016-09-27 11:23:58 UTC
See https://github.com/xamarin/Xamarin.Forms/pull/386