我正在为 windows phone 8.1 运行时开发应用程序,即商店应用程序。在这里,我将Storyboard动画应用于stackpanel,
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="StkPnl">
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.2"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="StkPnl">
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.2"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
</DoubleAnimationUsingKeyFrames>
在这里,我将其缩放为:
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.2"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
表示从 0.2 到 1,而不是从 0 到 1。
我的问题是:如果我将对象(此处为 stackpanel)从 0.2 缩放到 1,它看起来就像是模糊的,直到动画完成。如果我从 0 到 1 进行操作,那么效果很好。
更新 1:
<StackPanel x:Name="StkPnlName" Visibility="Collapsed" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,512,0,0" RenderTransformOrigin="0.5,0.5">
<StackPanel.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<TranslateTransform/>
</TransformGroup>
</StackPanel.RenderTransform>
<Grid>
<Ellipse Height="38" Width="38" Fill="Blue"/>
<FontIcon Glyph="ode" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" Foreground="White" FontFamily="{StaticResource Resource}"/>
</Grid>
<TextBlock Text="Text" Foreground="Black" MaxHeight="38" FontSize="14" TextAlignment="Center" Width="74" TextTrimming="WordEllipsis" TextWrapping="Wrap" Style="{StaticResource Resource}" FontWeight="SemiBold"/>
</StackPanel>
我错过了什么?有遇到过这种情况的请指教。谢谢。