首先,这是我极简版项目的链接。
我正在尝试在我的Pivot页面内创建一个类似于Tinder滑动卡片的效果。在参考了Lightstone Carousel之后,我能够在
现在我的问题是,自定义控件应该放在
根据@Romasz的回答,在Win 10应用程序中找不到
如果有其他具有类似效果的控件建议也将不胜感激。 XAML
根据@Chris W.的问题,以下两个链接展示了Tinder滑动效果:
1) Web版本
2) Objective C代码
如果想在应用中看到类似的效果,请删除包含的轴控制和轴项,就可以正常工作了。
编辑 根据@Romasz的评论,上传了一个新样例。有两个,上面的是我的自定义控件,左右滑动现在可以工作,但垂直滑动不行。下面是默认的ListView,滚动滑动一切正常,但没有Tinder的效果。创建此控件的唯一原因是添加效果。
我正在尝试在我的Pivot页面内创建一个类似于Tinder滑动卡片的效果。在参考了Lightstone Carousel之后,我能够在
C#
和XAML
中创建一个在Grid
内工作的控件。现在我的问题是,自定义控件应该放在
Pivot
元素内。由于Pivot的默认操作会覆盖我的控件在TOUCH设备上的滑动操作。我该如何将其传递到我的自定义控件?根据@Romasz的回答,在Win 10应用程序中找不到
Touch
。如果有其他具有类似效果的控件建议也将不胜感激。 XAML
<Pivot>
<PivotItem>
<Grid Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Background="LightBlue"/>
<Grid Grid.Row="1" >
<ctrl:Carrousel Grid.Row="0" Background="Green" ItemsSource="{Binding Datas}"
SelectedIndex="0"
TransitionDuration="2500"
Depth="700"
MaxVisibleItems="15"
x:Name="CarrouselElement"
Rotation="50"
TranslateY="0"
TranslateX ="1200">
<ctrl:Carrousel.EasingFunction>
<CubicEase EasingMode="EaseOut" />
</ctrl:Carrousel.EasingFunction>
<ctrl:Carrousel.ItemTemplate>
<DataTemplate>
<Grid Background="Red">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border BorderBrush="#bfbfbf" BorderThickness="1">
<Grid HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="{Binding BitmapImage}" Stretch="Fill"></Image>
<Border Grid.Row="1" Background="White">
<TextBlock Text="{Binding Title}" FontSize="16" Margin="4"/>
</Border>
</Grid>
</Border>
<Rectangle Grid.Row="1" Height="12" Margin="0,0,0,0" VerticalAlignment="Bottom" >
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#bfbfbf"/>
<GradientStop Color="Transparent" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</Grid>
</DataTemplate>
</ctrl:Carrousel.ItemTemplate>
</ctrl:Carrousel>
</Grid>
</Grid>
</PivotItem>
<PivotItem>
</PivotItem>
</Pivot>
根据@Chris W.的问题,以下两个链接展示了Tinder滑动效果:
1) Web版本
2) Objective C代码
如果想在应用中看到类似的效果,请删除包含的轴控制和轴项,就可以正常工作了。
编辑 根据@Romasz的评论,上传了一个新样例。有两个,上面的是我的自定义控件,左右滑动现在可以工作,但垂直滑动不行。下面是默认的ListView,滚动滑动一切正常,但没有Tinder的效果。创建此控件的唯一原因是添加效果。