From ad72c9b9ad7b9ddc1f39a0c0f8e671aa70ba35c3 Mon Sep 17 00:00:00 2001 From: Sebahattin Arslan Date: Fri, 27 Dec 2024 23:03:23 +0100 Subject: [PATCH] When the nuget package was created, the new select list elements were not visible. --- .../NullableDateTimePickerSelectList.cs | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Maui.NullableDateTimePicker/Controls/NullableDateTimePickerSelectList.cs b/Maui.NullableDateTimePicker/Controls/NullableDateTimePickerSelectList.cs index 72c16e5..6540aa1 100644 --- a/Maui.NullableDateTimePicker/Controls/NullableDateTimePickerSelectList.cs +++ b/Maui.NullableDateTimePicker/Controls/NullableDateTimePickerSelectList.cs @@ -76,7 +76,11 @@ public NullableDateTimePickerSelectList() _collectionView = new CollectionView { - ItemsLayout = new GridItemsLayout(3, ItemsLayoutOrientation.Vertical), + ItemsLayout = new GridItemsLayout(3, ItemsLayoutOrientation.Vertical) + { + HorizontalItemSpacing = 2, + VerticalItemSpacing = 2 + }, SelectionMode = SelectionMode.Single, HorizontalOptions = LayoutOptions.Fill, VerticalOptions = LayoutOptions.Fill, @@ -90,15 +94,19 @@ public NullableDateTimePickerSelectList() { var label = new Label { - TextColor = TextColor, + TextColor = Colors.Black, FontSize = 12, - VerticalOptions = LayoutOptions.Center, - HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Fill, + HorizontalOptions = LayoutOptions.Fill, + FontAttributes = FontAttributes.Bold, BackgroundColor = Colors.Transparent, - Background = Colors.Transparent + VerticalTextAlignment = TextAlignment.Center, + HorizontalTextAlignment = TextAlignment.Center, + Padding = 0, + Margin = 0 }; - label.SetBinding(Label.TextProperty, new Binding(ItemDisplayBinding ?? ".", source: label.BindingContext)); + label.SetBinding(Label.TextProperty, new Binding(ItemDisplayBinding ?? ".")); var border = new Border { @@ -106,8 +114,10 @@ public NullableDateTimePickerSelectList() { CornerRadius = new CornerRadius(5, 5, 5, 5) }, - Margin = 2, + Margin = 0, Padding = 5, + VerticalOptions = LayoutOptions.Fill, + HorizontalOptions = LayoutOptions.Fill, Content = label };