VisualElement.MinimumWidthRequest Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value which overrides the minimum width the element will request during layout.
public double MinimumWidthRequest { get; set; }
member this.MinimumWidthRequest : double with get, set
Property Value
The minimum width the element requires. Default value is -1.
Remarks
MinimumWidthRequest is used to override the results of a call to 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 its normal size.
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 {
label,
image
}
};
}