zoukankan      html  css  js  c++  java
  • 为什么不能在scrollview中直接添加一个image,然后使animation.begin()??

    http://stackoverflow.com/questions/17267451/animation-cant-begin-in-scrollview-in-windows-phone

    以上是我在SO中提的一个问题

    我简单贴下代码,问题描述在上述网址中

    <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>

    最终动画在wp device上没有运作

    虽然在blend中表现良好!

    原因是:

    http://msdn.microsoft.com/zh-cn/library/windowsphone/develop/jj206955%28v=vs.105%29.aspx

    2. 创建情节提要并将其变成资源

    Storyboard 是您存放动画对象的容器。您必须将 Storyboard 变成可用于要进行动画处理的对象的资源。下面的 XAML 演示如何将 Storyboard 变成根元素的资源(一个 StackPanel)。

    <StackPanel x:Name="rootElement">
        <StackPanel.Resources>
        <!-- Animates the rectangle's opacity. -->
            <Storyboard x:Name="myStoryboard">
                <!-- Animation objects go here. -->
            </Storyboard>
        </StackPanel.Resources>
    </StackPanel>
    

  • 相关阅读:
    Delphi命名规则
    highcharts 折线,饼状,条状综合图
    Highcharts创建一个简单的柱状图
    创建一个简单的WCF程序
    VS快捷键大全
    2021.05.28 手写简易web服务器
    2021.05.23 春眠不觉晓,optional知多少……
    springboot整合ActiveMQ实现异步交易
    安利一款云容器管理工具portainer……
    uglifyjs压缩js文件(指令压缩/ 批量压缩/ 编程方式压缩)
  • 原文地址:https://www.cnblogs.com/fifa0329/p/4536671.html
Copyright © 2011-2022 走看看