[英]how to splash screen static for wp7 phonegap
How to make a splash screen static until the app loads then hide when app is loaded? 如何在启动应用程序之前使启动画面静态,然后在加载应用程序时隐藏?
This is how it is in wp7 phonegap. 这就是wp7 phonegap中的情况。
public partial class MainPage : PhoneApplicationPage
{
private WebBrowserHelper _browserHelper;
// Constructor
public MainPage()
{
InitializeComponent();
this.PGView.Loaded += GapBrowser_Loaded;
_browserHelper = new WebBrowserHelper(PGView.Browser);
this.PGView.Browser.ScriptNotify += Browser_ScriptNotify;
}
private void GapBrowser_Loaded(object sender, RoutedEventArgs e)
{
this.PGView.Loaded -= GapBrowser_Loaded;
Storyboard _storyBoard = new Storyboard();
DoubleAnimation animation = new DoubleAnimation()
{
From = 0,
Duration = TimeSpan.FromSeconds(0.6),
To = 90
};
Storyboard.SetTarget(animation, SplashProjector);
Storyboard.SetTargetProperty(animation, new PropertyPath("RotationY"));
_storyBoard.Children.Add(animation);
_storyBoard.Begin();
_storyBoard.Completed += Splash_Completed;
}
void Splash_Completed(object sender, EventArgs e)
{
(sender as Storyboard).Completed -= Splash_Completed;
LayoutRoot.Children.Remove(SplashImage);
}
private void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
// if a page notifies that it should not be scrollable, disable
// scrolling.
if (e.Value == "noScroll")
{
_browserHelper.ScrollDisabled = true;
}
}
} }
if you only need a simple splash picture, why not change SplashScreenImage.jpg in app ? 如果您只需要一个简单的启动画面,为什么不在应用程序中更改SplashScreenImage.jpg?
i do not very clear why WebBrowserHelper 我不太清楚为什么使用WebBrowserHelper
from your code , i can see you display your picture after mainpage loaded. 从您的代码中,我可以看到您在加载主页后显示图片。 because you call _storyBoard.Begin(); 因为您调用_storyBoard.Begin(); in GapBrowser_Loaded event handle 在GapBrowser_Loaded事件句柄中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.