zoukankan      html  css  js  c++  java
  • 简单的动画定义及调用

    定义名字

    <phone:PhoneApplicationPage 
        x:Name="mainPage"

    在 xaml 定义动画资源

        <phone:PhoneApplicationPage.Resources>
            <Storyboard x:Name="GoLeft">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetX)" Storyboard.TargetName="mainPage">
                    <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-500"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Name="GoRight">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetX)" Storyboard.TargetName="mainPage">
                    <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="500"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Name="ComeLeft">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetX)" Storyboard.TargetName="mainPage">
                    <EasingDoubleKeyFrame KeyTime="0" Value="-500"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Name="ComeRight">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetX)" Storyboard.TargetName="mainPage">
                    <EasingDoubleKeyFrame KeyTime="0" Value="500"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </phone:PhoneApplicationPage.Resources>
        <phone:PhoneApplicationPage.Projection>
            <PlaneProjection/>
        </phone:PhoneApplicationPage.Projection>

    调用动画

                        GoLeft.Completed += new EventHandler((sender, eventargs) =>
                            {
                                ComeRight.Begin(); //从右回
                            });
                        GoRight.Completed += new EventHandler((sender, eventargs) =>
                            {
                                ComeLeft.Begin(); //从左回
                            });
                        if (tmpstartid > startid)
                            GoLeft.Begin(); //向左走
                            else if (tmpstartid < startid) GoRight.Begin(); //向右走
  • 相关阅读:
    函数的调用过程
    Android基础-弹出式菜单
    Android基础-上下文菜单(Content_Menu)
    Adnroid基础-选项菜单(OptionMenu)
    Android基础-UI界面(项目实战 点菜界面) 1.EditText 2.SeekBar 3.CheckBox 4.ToggleButton 5.RadioGroup 6.Button 7.TextView 8.ImageView
    Android基础-进度条(SeekBar)
    Android基础-开关按钮(ToggleButton)
    Android基础-单选框(RadioButton)
    显示应用名称
    在Xcode中使用pch文件
  • 原文地址:https://www.cnblogs.com/fatdaniel/p/3640421.html
Copyright © 2011-2022 走看看