[英]Storyboard animation doesn't animate
我最近开始学习WP8.1,目前正在尝试制作动画。
我要做的是给初始屏幕动画,如书页:从背面过来,然后,当它覆盖整个屏幕并且您触摸它时,就像旋转书页一样继续旋转。 动画的第一部分还可以,但是我不知道为什么第二部分(第二个故事板)没有动画。 片刻之后,矩形仅占据了它应该占据的最后位置,而没有进行动画处理(这很丑陋!)。
这是我的情节提要(很复杂):
<Storyboard x:Name="EndgameSplashInStoryboard">
<!--<DoubleAnimation Duration="0:0:0.3" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="EndgameSplashGrid" d:IsOptimized="True"/>-->
<DoubleAnimation Duration="0:0:0.3" By="70" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="EndgameSplashGrid" d:IsOptimized="True"/>
</Storyboard>
<Storyboard x:Name="EndgameSplashOutStoryboard">
<!--<DoubleAnimation Duration="0:0:0.3" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="EndgameSplashGrid" d:IsOptimized="True"/>-->
<DoubleAnimation Duration="0:0:0.3" By="70" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="EndgameSplashGrid" d:IsOptimized="True"/>
</Storyboard>
我评论了不透明度动画以简化动画。 这是我要设置动画的内容:
<Grid x:Name="EndgameSplashGrid">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.Projection>
<PlaneProjection x:Name="EndgameSplashProjection" RotationY="-70" CenterOfRotationX="0"/>
</Grid.Projection>
<Rectangle x:Name="EndgameSplashRectangle" Grid.RowSpan="2" Fill="{StaticResource PhoneAccentBrush}" Tapped="EndgameSplashRectangle_Tapped"/>
<TextBlock x:Name="EndgameSplashText" Grid.Row="0" Text="victoire!" Style="{StaticResource EndgameSplashText}"/>
<TextBlock x:Name="EndgameSplashSubtext" Grid.Row="1" TextWrapping="Wrap" Style="{StaticResource EndgameSplashSubtext}"
Text="Félicitations, vous avez trouvé le nombre en 7 essais :-)"/>
</Grid>
如果有人知道为什么会发生这种情况,那将非常有帮助:)谢谢,祝您有美好的一天!
因此,我了解到动画的第一个标准杆可以播放,但是第二个不可以吗? 如果将它们放在一个故事板上,在第二个中设置BeginTime="0:0:0.3"
怎么办?
编辑:哦,我只是看到,它是完全相同的动画,并且您希望它播放两次? 然后,您可以只添加属性RepeatBehavior="2x"
。
如果要在同一属性上一个接一个地播放两个不同的动画,则可以使用DoubleAnimationUsingKeyFrames
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.