如何解决Xamarin、TapGestureRecognizer 不起作用
我不明白为什么 TapGestureRecognizer Command = "{Binding PointViewCommand}" CommandParameter = "{Binding Start.RoutePoint}" 似乎重叠了一些东西。我抓住那里的按钮,按钮点击。如果我在 ScrollView 之后将 TapGestureRecognizer 放入第一个 StackLayout 中,它可以工作,但它不适合我,因为有一个列表,我需要单击特定记录。
<ScrollView IsVisible="{Binding IsSetActiveRoute}" IsEnabled="{Binding IsSetActiveRoute}" InputTransparent="True">
<StackLayout BindableLayout.ItemsSource="{Binding RouteListDoc.RowsRoute}" Padding="5">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame CornerRadius="5" OutlineColor="#c3c3c3" BackgroundColor="#F2FFFFE0">
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand">
<StackLayout Orientation="Horizontal">
<StackLayout HorizontalOptions="StartAndExpand" WidthRequest="125">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Command="{Binding PointViewCommand}" CommandParameter="{Binding Start.RoutePoint}" />
</StackLayout.GestureRecognizers>
<Label Text="{Binding Start.RoutePoint}" FontAttributes="Bold" FontSize="Large"/>
<Label Text="Вікно доставки:" FontSize="Medium" FontAttributes="Bold" />
<Label Text="{Binding Start.Windows}" FontSize="Medium" />
</StackLayout>
<StackLayout HorizontalOptions="StartAndExpand" WidthRequest="80">
<Image Source="arrow.png" HorizontalOptions="CenterandExpand" />
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Label Text="Пал:" FontSize="Medium" FontAttributes="Bold" />
<Label Text="{Binding Finish.Pal}" FontSize="Medium" />
</StackLayout>
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Label Text="КГ:" FontSize="Medium" FontAttributes="Bold" />
<Label Text="{Binding Finish.KG}" FontSize="Medium" />
</StackLayout>
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Label Text="КМ:" FontSize="Medium" FontAttributes="Bold" />
<Label Text="{Binding Start.KM}" FontSize="Medium" />
</StackLayout>
</StackLayout>
<StackLayout HorizontalOptions="EndAndExpand" WidthRequest="125">
<Label Text="{Binding Finish.RoutePoint}" FontAttributes="Bold" FontSize="Large" />
<Label Text="Вікно доставки:" FontSize="Medium" FontAttributes="Bold" />
<Label Text="{Binding Finish.Windows}" FontSize="Medium" />
</StackLayout>
</StackLayout>
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</StackLayout>
</ScrollView>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。