【发布时间】:2013-06-24 03:02:26
【问题描述】:
我想实现这样的效果:
有一个 80*80 的滚动视图,我在里面放了一个 160*80 的图片
1s:滚动视图中的图片左/上,2s:滚动视图中的图片右/上
滚动作为一个过渡过程
我的代码:
xaml
<UserControl.Resources>
<Storyboard x:Name="Storyboard1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="my_combo_pic">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="80"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="my_combo_pic">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
...
<ScrollViewer x:Name="my_combo" Tap="MyCombolIconTapped" HorizontalAlignment="Right" Height="80" Margin="0" VerticalAlignment="Bottom" Width="80">
<Image x:Name="my_combo_pic" Stretch="Fill" Source="/Images/my_combo_icon.png" RenderTransformOrigin="0.5,0.5" Height="160" Width="80">
<Image.RenderTransform>
<CompositeTransform/>
</Image.RenderTransform>
</Image>
</ScrollViewer>
</Grid>
cs
Storyboard1.Begin();
在加载中
但是,我发现即使在表情混合中效果很好,动画也不起作用
那么,你能帮我找出原因吗???
或者给我另一种实现方式
谢谢你!!!
任何建议都会很棒
【问题讨论】:
标签: windows-phone-7 animation windows-phone-8 blend