Hi all
i facing item tap issue on my project , listview item is not working when double tap middle of the item , but it happen tap corner of the item ..
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ATAS.Views.TABLE"
xmlns:listView="clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView">
<ContentPage.Resources>
<ResourceDictionary>
<Style TargetType="Label" x:Key="Label1">
<Setter Property="VerticalTextAlignment" Value="Center"/>
<Setter Property="HorizontalTextAlignment" Value="Center"/>
<Setter Property="HorizontalOptions" Value="CenterAndExpand"/>
<Setter Property="VerticalOptions" Value="CenterAndExpand"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="TextColor" Value="Red"/>
</Style>
<Style TargetType="Label" x:Key="Label2">
<Setter Property="VerticalTextAlignment" Value="Center"/>
<Setter Property="HorizontalTextAlignment" Value="End"/>
<Setter Property="Margin" Value="0,0,8,0"/>
<Setter Property="FontSize" Value="13.5"/>
<Setter Property="FontFamily" Value="OpenSansSemibold"/>
<Setter Property="TextColor" Value="Black"/>
</Style>
<Style TargetType="Label" x:Key="Label3">
<Setter Property="VerticalTextAlignment" Value="Center"/>
<Setter Property="HorizontalTextAlignment" Value="Start"/>
<Setter Property="FontSize" Value="13.5"/>
<Setter Property="Margin" Value="6,0,0,0"/>
<Setter Property="FontFamily" Value="OpenSansSemibold"/>
<Setter Property="TextColor" Value="Black"/>
</Style>
<Style TargetType="Button" x:Key="SubMenuButton">
<Setter Property="HorizontalOptions" Value="CenterAndExpand"/>
<Setter Property="VerticalOptions" Value="CenterAndExpand"/>
<Setter Property="FontSize" Value="13.5"/>
<Setter Property="HeightRequest" Value="90"/>
<Setter Property="WidthRequest" Value="90"/>
<Setter Property="CornerRadius" Value="6"/>
<Setter Property="Margin" Value="10,0,10,0"/>
<Setter Property="FontFamily" Value="OpenSansSemibold"/>
<Setter Property="TextColor" Value="White"/>
</Style>
<Style TargetType="Button" x:Key="TableStatusButton">
<Setter Property="HorizontalOptions" Value="CenterAndExpand"/>
<Setter Property="VerticalOptions" Value="CenterAndExpand"/>
<Setter Property="FontSize" Value="9"/>
<Setter Property="HeightRequest" Value="35"/>
<Setter Property="WidthRequest" Value="120"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="FontFamily" Value="OpenSansSemibold"/>
<Setter Property="TextColor" Value="White"/>
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<AbsoluteLayout>
<Grid AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="100"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<listView:SfListView x:Name="TablelstViewData"
ItemTapped="TablelstViewData_ItemTapped"
ItemSize="130"
WidthRequest="1024"
Grid.Row="0" Grid.Column="0"
SelectionMode="Single">
<listView:SfListView.ItemsLayout>
<listView:GridLayout SpanCount="5" x:Name="gridLayout"/>
</listView:SfListView.ItemsLayout>
<!--#region Listing-->
<listView:SfListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Frame Padding="0" BackgroundColor="White" Margin="2" HeightRequest="140" WidthRequest="140">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="43"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<StackLayout Grid.Row="0" BackgroundColor="#3cb371">
<Label Text="{Binding TableNo}" TextColor="White"
FontSize="23" FontAttributes="Bold"
HorizontalTextAlignment="Start"
VerticalTextAlignment="Center"
Margin="8,0,0,0"
VerticalOptions="CenterAndExpand"/>
</StackLayout>
<Label Grid.Row="1" Text="RM 39.00"
FontAttributes="Bold" FontSize="18"
Margin="8,0,0,0" TextColor="Red"/>
<Label Grid.Row="2" Text="IN : 4.45PM"
FontAttributes="Bold" FontSize="18"
Margin="8,0,0,0" TextColor="Blue"/>
<Label Grid.Row="3" Text="ITEM : 9"
FontAttributes="Bold" FontSize="16"
Margin="8,0,0,0" TextColor="Blue"/>
</Grid>
</Frame>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</listView:SfListView.ItemTemplate>
<!--#endregion-->
</listView:SfListView>
<!--#region Bottom Bar-->
<!--#region pop up-->
<ContentView x:Name="popupNumberPax" IsVisible="false" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All">
<Frame CornerRadius="6" WidthRequest="380" HeightRequest="280" BorderColor="MediumPurple" Padding="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="80"/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackLayout Grid.Row="0" Grid.Column="0" BackgroundColor="MediumPurple" WidthRequest="380" HeightRequest="50"
HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
<Label Text="Enter Pax Number" TextColor="Black" FontSize="26" FontAttributes="Bold" HeightRequest="60"
HorizontalTextAlignment="Center" VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"/>
</StackLayout>
<StackLayout Grid.Row="1" Grid.Column="0" VerticalOptions="CenterAndExpand" Margin="0,18,0,0">
<Entry PlaceholderColor="MediumPurple" WidthRequest="300" HeightRequest="60"
Keyboard="Numeric" Placeholder="Number of Pax"/>
</StackLayout>
<HorizontalStackLayout Grid.Row="2" HeightRequest="70" HorizontalOptions="CenterAndExpand">
<Button Text="OK" x:Name="Btn_OK_pax" Clicked="Btn_OK_pax_Clicked" HeightRequest="60" WidthRequest="90"/>
<Button Text="Cancel" HeightRequest="60" WidthRequest="90" Margin="20,0,0,0"
x:Name="Btn_Cancel_Pax" Clicked="Btn_Cancel_Pax_Clicked"/>
</HorizontalStackLayout>
</Grid>
</Frame>
<!--<Grid VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" BackgroundColor="LightGrey">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="300"/>
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0">
<Entry></Entry>
</StackLayout>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Button Grid.Row="0" Grid.Column="0" Text="1"/>
<Button Grid.Row="0" Grid.Column="1" Text="1"/>
<Button Grid.Row="0" Grid.Column="2" Text="1"/>
</Grid>
</Grid>-->
</ContentView>
<!--#endregion-->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="350"/>
</Grid.ColumnDefinitions>
<HorizontalStackLayout BackgroundColor="LightGray" Grid.Column="0">
<Button BackgroundColor="#03719c" WidthRequest="85"
HeightRequest="85" Margin="20,0,20,0"
TextColor="White" Text="Take Away" LineBreakMode="WordWrap"/>
<Button BackgroundColor="#03719c" WidthRequest="85"
HeightRequest="85" Text="Session 1" Margin="20,0,20,0" LineBreakMode="WordWrap"/>
<Button BackgroundColor="#03719c" WidthRequest="85"
HeightRequest="85" Text="Session 2" Margin="20,0,20,0" LineBreakMode="WordWrap"/>
<Button BackgroundColor="#03719c" WidthRequest="85"
HeightRequest="85" Text="Online Booking" Margin="20,0,20,0" LineBreakMode="WordWrap"/>
<Button BackgroundColor="#03719c" WidthRequest="85"
HeightRequest="85" Text="Booking List" Margin="20,0,20,0" LineBreakMode="WordWrap"/>
<Button BackgroundColor="#03719c" WidthRequest="85"
HeightRequest="85" Text="Sales History" Margin="20,0,20,0" LineBreakMode="WordWrap"/>
<Button BackgroundColor="Red" WidthRequest="85"
HeightRequest="85" Text="EXIT"
TextColor="White" Margin="20,0,20,0"/>
</HorizontalStackLayout>
<Grid Grid.Column="1" BackgroundColor="LightGray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<HorizontalStackLayout Grid.Row="0">
<Button Text="Empty" BackgroundColor="#3cb371" Style="{StaticResource TableStatusButton}"/>
<Button Text="On Cleaning" BackgroundColor="Black" Style="{StaticResource TableStatusButton}" Margin="10,0,0,0"/>
</HorizontalStackLayout>
<HorizontalStackLayout Grid.Row="1">
<Button Text="Occupied" BackgroundColor="HotPink" Style="{StaticResource TableStatusButton}"/>
<Button Text="On Hold" BackgroundColor="LightYellow" Style="{StaticResource TableStatusButton}" Margin="10,0,0,0"/>
</HorizontalStackLayout>
</Grid>
</Grid>
</Grid>
<!--#endregion-->
</Grid>
</AbsoluteLayout>
</ContentPage.Content>
</ContentPage>
Hi Anson,
We have checked the reported scenario “item tap not working” on our end we are able to reproduce the issue in android platform, we would like to let you know that you have used the frame in the ItemTemplate , we have already faced this issue in framework level and logged the bug in the framework level. Please refer the below bug report regarding this issue.
Please refer to the framework issue report for more reference,
Bug report: https://github.com/dotnet/maui/issues/8330
As a workaround, we recommend using the Grid or Border control, which can be customized to achieve a similar UI. Please let us know if you are experiencing this issue on any other platforms.
Regards,
Suthi Yuvaraj
Thanks for advise , is worked ...appreciate it~~
another issue is appear ...the list view spacing will change after i tap the button
you may refer the 2 picture which i attached ...
Anson,
We have checked the reported query “the list view spacing will change after I tap the button “, we have created a sample with provided code snippet , we are unable to reproduce the issue at our end. Additionally, we noticed that the SpanCount appears to be changed in the second image, however, tapping an item should not change the SpanCount. Please share the below details which will be more helpful for us to find the appropriate solution as soon as possible.