From ac415851a08252657d79c175e828333165b9cc62 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Wed, 3 Apr 2024 22:28:10 +0300 Subject: [PATCH 1/2] Expand PickerField width inside InputField --- src/UraniumUI.Material/Controls/PickerField.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/UraniumUI.Material/Controls/PickerField.cs b/src/UraniumUI.Material/Controls/PickerField.cs index 013fb260..4d155c38 100644 --- a/src/UraniumUI.Material/Controls/PickerField.cs +++ b/src/UraniumUI.Material/Controls/PickerField.cs @@ -18,7 +18,6 @@ public class PickerField : InputField public override View Content { get; set; } = new PickerView { VerticalOptions = LayoutOptions.Center, - HorizontalOptions = LayoutOptions.Fill, Margin = new Thickness(15, 0), #if WINDOWS Opacity = 0, @@ -87,7 +86,7 @@ public PickerField() protected override void OnSizeAllocated(double width, double height) { base.OnSizeAllocated(width, height); - PickerView.WidthRequest = width * .5; // TODO:Make this value dynamic later. + PickerView.WidthRequest = (width * .96f) - (AllowClear ? iconClear.Width : 0) - (imageIcon.IsValueCreated ? imageIcon.Value.Width : 0); // TODO:Make this value dynamic later. } #endif From 1016e477badd247fca2dddc3fd974ca165f67a57 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Wed, 3 Apr 2024 22:31:18 +0300 Subject: [PATCH 2/2] Use MinimumWidthRequest instead WidthRequest --- src/UraniumUI.Material/Controls/PickerField.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UraniumUI.Material/Controls/PickerField.cs b/src/UraniumUI.Material/Controls/PickerField.cs index 4d155c38..9434720d 100644 --- a/src/UraniumUI.Material/Controls/PickerField.cs +++ b/src/UraniumUI.Material/Controls/PickerField.cs @@ -86,7 +86,7 @@ public PickerField() protected override void OnSizeAllocated(double width, double height) { base.OnSizeAllocated(width, height); - PickerView.WidthRequest = (width * .96f) - (AllowClear ? iconClear.Width : 0) - (imageIcon.IsValueCreated ? imageIcon.Value.Width : 0); // TODO:Make this value dynamic later. + PickerView.MinimumWidthRequest = (width * .96f) - (AllowClear ? iconClear.Width : 0) - (imageIcon.IsValueCreated ? imageIcon.Value.Width : 0); } #endif