动画中的Windows Phone 8.1不工作 [英] Animation not working in Windows Phone 8.1

查看:148
本文介绍了动画中的Windows Phone 8.1不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想在我的Windows Phone 8.1应用程序创建一个简单的动画

I am just trying to create a simple animation in my Windows Phone 8.1 Application

我想通过一些300毫秒的时期,这最终使用6-7图像留下一个自定义动画变化的6幅图像创建一个动画效果。

I am thinking to create an animation effect by changing 6 images at some 300 milliseconds period, which ends up leaving a custom animation using 6-7 images.

但下面的code中的问题是,它不是建立一个闪烁效果,它只是显示第一个图像,然后最后一个。

but the problem with the below code is, it isn't creating a flicker effect, it just displays 1st image and then last one.

我试图增加的时间段,但仍然是相同的。

I tried increasing the time period, but still the same.

animationBg = new ObjectAnimationUsingKeyFrames();
storyboardBG = new Storyboard();
Storyboard.SetTarget(animationBg, imgMinuteBackground);
Storyboard.SetTargetProperty(animationBg, "Source");
storyboardBG.Children.Add(animationBg);
AddFrame(animationBg, "Images/clockbg2.png", 50);
AddFrame(animationBg, "Images/clockbg3.png", 100);
AddFrame(animationBg, "Images/clockbg4.png", 150);
AddFrame(animationBg, "Images/clockbg5.png", 200);
AddFrame(animationBg, "Images/clockbg6.png", 250);
AddFrame(animationBg, "Images/clockbg1.png", 300);
storyboardBG.Begin();


//AddFrame Function:
public void AddFrame( ObjectAnimationUsingKeyFrames animation, string strImagePath, int interval)
{
    var keyframe = new DiscreteObjectKeyFrame 
    {
         KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(interval)),
         Value = strImagePath
    };
    animation.KeyFrames.Add(keyframe);
}

我改变了源,以新的PropertyPath(源),它正在为Windows Phone 7的应用程序。

I changed the "Source" to new PropertyPath("Source") and it is working for Windows Phone 7 Applications.

推荐答案

由于在MSDN上的教程,动画仅适用于Windows Phone的8.1 ​​Silverlight应用程序说明。
<一href=\"http://msdn.microsoft.com/en-us/library/windows/apps/jj206955(v=vs.105).aspx#BKMK_Startingstoppingpausingandresuming\" rel=\"nofollow\">http://msdn.microsoft.com/en-us/library/windows/apps/jj206955(v=vs.105).aspx#BKMK_Startingstoppingpausingandresuming

As stated on MSDN tutorial, animation only available for Windows Phone 8.1 Silverlight app. http://msdn.microsoft.com/en-us/library/windows/apps/jj206955(v=vs.105).aspx#BKMK_Startingstoppingpausingandresuming

适用于:Windows Phone 8的和Windows Phone的Silverlight 8.1 |的Windows Phone OS 7.1

Applies to: Windows Phone 8 and Windows Phone Silverlight 8.1 | Windows Phone OS 7.1

这将不适用于Windows手机应用程序8.1工作

It will not work for Windows phone 8.1 app

这篇关于动画中的Windows Phone 8.1不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆