0
我創建了一個Storyboard來爲我的Canvas上以編程方式放置的圖像控件進行動畫製作。故事板是在Expression Blend中創建的。故事板WP7 - 座標
當我玩故事板時,圖像消失,並在其他地方動畫(我最終看到圖像控制最後飛入)。它不會動畫我放置圖像的位置。 Storyboard的作品,但它不動畫我想讓它動畫的地方。 控制器假設在屏幕的底部和特定圖像的右側進行動畫處理。這就是爲什麼我通過代碼改變圖像的位置。
這裏是XML:
<Storyboard x:Name="sbBagExit">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.SkewX)" Storyboard.TargetName="imgBag">
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="11"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="10.9973"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="imgBag">
<EasingDoubleKeyFrame KeyTime="0" Value="332"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="332"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="332"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="imgBag">
<EasingDoubleKeyFrame KeyTime="0" Value="-16"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="169.983"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Name="sbBagDrop">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="imgBag">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="imgBag">
<EasingDoubleKeyFrame KeyTime="0" Value="-172"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="332.001"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="344"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="332"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="imgBag">
<EasingDoubleKeyFrame KeyTime="0" Value="-8"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="-8"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="-8"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="imgBag">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.829"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="imgBag">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1.2"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
第二個故事板後的第一個直接反應。
我一直在撓我的頭好好兩個星期....任何人都可以看到我不能?
非常感謝您提前。
如何在Expression Blend中創建它,以便我不會出現此錯誤? – Subby 2012-08-03 20:40:14
使容器和元素與您應用的元素完全相同。我更喜歡只使用相對座標,因此動畫的By屬性或只有To屬性(沒有指定From屬性)被設置。這可以防止那些奇怪的300號碼。 – 2012-08-03 20:47:07