Hello, I have this problem:
I created a ListView like this:
<ListView x:Name="ListRoutes" ItemsSource="{Binding Routes}"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid Margin="0,10"> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.5"/> <ColumnDefinition Width="0.5"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="auto"/> </Grid.RowDefinitions> <StackLayout Grid.Column="0" Grid.Row="0" VerticalOptions="EndAndExpand"> <Label Text="Depart"/> **<DatePicker x:Name="DatePicker" Date="{Binding RouteDate}" MinimumDate="{Binding RouteDate}" MaximumDate="12/31/2050" WidthRequest="100"/>** </StackLayout> <StackLayout Grid.Column="1" Grid.Row="0" Orientation="Horizontal" VerticalOptions="EndAndExpand" HorizontalOptions="FillAndExpand" Padding="0,5,0,0"> <Entry Style="{StaticResource BordingEntry}" HorizontalOptions="FillAndExpand" Text="{Binding TimeHour}" Keyboard="Numeric"/> <Label Text=":" VerticalTextAlignment="Center"/> <Entry Style="{StaticResource BordingEntry}" HorizontalOptions="FillAndExpand" Text="{Binding TimeMinute}" Keyboard="Numeric"/> </StackLayout> </Grid> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView>
The problem is that each time I tap on any entry, the DatePicker showsUp, even when I stop typing in an entry the datepicker shows up
I don't know if it is because the listview doesnt support a datepicker or what ...
Any idea? Thanks!!!
Answers
Can you please fix your markdown so the site doesn't try to render your XAML? Then people can be sure what they are reading isn't missing anything.
https://redpillxamarin.com/2016/12/13/faq-frequently-asked-questions/
A couple testing/confirmation suggestions.
1. Set the
BackgroundColor
of yourEntry
s andDatePicker
to obvious and different colors likeLime
andFuschia
. This often reveals that controls are wider or taller and taking more space than we think they are. That alone can solve mysteries when we learn that we're really tapping on a control that we didn't realize we were tapping on.2. Take out the
AndExpand
on theDatePicker
. This could account for the control going wider than you think and thus you are tapping it without knowing.3. Try tapping on the
Entry
with a stylus or through a remote control app like Vyser using your PC mouse. That will ensure that you are really tapping ONLY on theEntry
and not getting a tap on 2 or controls in a small screen real estate. Its easy for a big finger to tap on 2-3 items at once.Thank you for your answer, I did it all what you said and all is normal!!
I had to use SyncfusionListview, and it helped me to solve it
Sooo, I think that there is a bug in there with the Native ListView
Do me a favor? Go ahead and fix the XAML of your post even though you've got a solution. I want to copy it into one of my own projects to test this with, using the native
ListView
to see if I get the same behavior.Seems to work as expected in UWP

Seems to work as expected in Android

I don't think its a bug in the OEM controls. Probably just something in your XAML where controls are overlapping.
Thank you very much for your support!! I just edited my code with Markdown as you said.