微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Xamarin Android TapGestureRecognizer无法启动

如何解决Xamarin Android TapGestureRecognizer无法启动

因此,下面的xaml具有名为HotelReservationoption_Tapped方法背后的代码,该方法仅在Android中不触发。我正在为Syncfusion.Xamarin.SFListView使用版本18.3.0.40。

使用Xamarin.Forms v4.8.0.560

    <StackLayout x:Name="ActiveList" IsVisible="{Binding IsActiveListVisible}" Padding="0" Spacing="0" Margin="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
        <syncfusion:SfListView AutoFitMode="Height" ItemsSource="{Binding ReservationListActive}" SelectionBackgroundColor="Transparent" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Margin="0,10,0">
            <syncfusion:SfListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <StackLayout>
                            <ScrollView VerticalOptions="FillAndExpand">
                                <Grid>
                                    <Grid.RowDeFinitions>
                                        <RowDeFinition Height="*"/>
                                        <RowDeFinition Height="Auto"/>
                                    </Grid.RowDeFinitions>
                                    <StackLayout Grid.Row="0" Margin="20,9,20,14" Orientation="Horizontal">
                                        <StackLayout Orientation="Vertical" Spacing="6">
                                            <Label Text="{Binding HotelName}" TextColor="{StaticResource LabelColor}" FontSize="18"/>
                                            <StackLayout Orientation="Horizontal" Spacing="9">
                                                <Image Source="calendarPageEmpty1"/>
                                                <Label Text="{Binding HotelName}" TextColor="{StaticResource LightGrey2}" FontSize="14"/>
                                            </StackLayout>
                                        </StackLayout>
                                        <Image HorizontalOptions="EndAndExpand" Source="dots.png" HeightRequest="20" WidthRequest="20" BackgroundColor="Transparent">
                                            <Image.GestureRecognizers>
                                                <TapGestureRecognizer Tapped="HotelReservationoption_Tapped" CommandParameter="{Binding HotelID}"/>
                                            </Image.GestureRecognizers>
                                        </Image>
                                    </StackLayout>
                                    <BoxView Grid.Row="1" HeightRequest="1" Color="{StaticResource LineColor}"/>
                                </Grid>
                            </ScrollView>
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>
            </syncfusion:SfListView.ItemTemplate>
        </syncfusion:SfListView>
    </StackLayout>

有人知道此控件特定于Android的任何错误吗?

解决方法

我们已经基于Android中的代码段测试了简单的ListView示例。请从此处找到可行的示例。

示例:https://www.syncfusion.com/downloads/support/directtrac/general/ze/3015061347217706

如果您仍然遇到相同的问题,能否请您检查样本并返回原样?如果没有,请修改示例并共享设备配置详细信息。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。