繁体   English   中英

如何为wp7 phonegap启动静态屏幕

[英]how to splash screen static for 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;
        }
    }

}

如果您只需要一个简单的启动画面,为什么不在应用程序中更改SplashScreenImage.jpg?

我不太清楚为什么使用WebBrowserHelper

从您的代码中,我可以看到您在加载主页后显示图片。 因为您调用_storyBoard.Begin(); 在GapBrowser_Loaded事件句柄中

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM