Xamarin.Forms Guides | Samples

Xamarin.Forms.VisualElement.MinimumWidthRequest Property

Gets or sets a value which overrides the minimum width the element will request during layout.


public Double MinimumWidthRequest { get; set; }


The minimum width the element requires. Default value is -1.


MinimumWidthRequest is used to override the results of a call to VisualElement.GetSizeRequest (double, double) by setting the minimum width property. This causes overflow handling to shrink this element to its minimum width before elements who do not have a minimum size set.

The following example sets the MinimumWidthRequest to enable an image to shrink below it's normal size.

C# Example

  void Build (string veryLongString)
    var label = new Label {Text = veryLongString};
    var image = new Image {Source = "image500x500.png"};

    image.MinimumWidthRequest = 20;
    Content = new StackLayout {
      Orientation = StackOrientation.Horizontal,
      Children {


Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,,,,