[英]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.