我已经尝试了一段时间,使我的carousel视图可点击,并使用它来导航到其他页面/ shell 。
<CarouselView ItemsSource="{Binding Games}" HeightRequest="280" PeekAreaInsets="100">
<CarouselView.ItemTemplate>
<DataTemplate x:DataType="viewmodels:NewGames">
<StackLayout>
<Frame HeightRequest="300"
WidthRequest="180"
BackgroundColor="white"
Padding="0"
CornerRadius="10"
HasShadow="True"
Margin="15"
HorizontalOptions="CenterAndExpand">
<Grid>
<StackLayout BackgroundColor="DimGray">
<Image Source="{Binding ImageSource}" Aspect="AspectFill">
</Image>
</StackLayout>
<StackLayout Margin="-5">
<Label Text="{Binding GameTitle}"
TextColor="PaleGoldenrod"
FontSize="18"
FontAttributes="Bold"
Margin="15"
VerticalOptions="EndAndExpand"/>
</StackLayout>
</Grid>
</Frame>
</StackLayout>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
我在carousel view选项卡下查看了xamarin文档,但没有找到任何有用的东西。
1条答案
按热度按时间pbwdgjma1#
您可以尝试添加一个
TapGestureRecognizer
到Frame
,如Jason建议如下。