2012-10-12 61 views
0

如何使閃屏靜態,直到應用程序加載然後隱藏應用程序加載時?如何啓動屏幕靜態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; 
     } 
    } 

}

回答

0

如果你只需要一個簡單的飛濺的畫面,爲什麼不能在應用程序改變SplashScreenImage.jpg?

我不很清楚爲什麼WebBrowserHelper

從您的代碼,我可以看到你展示你的照片炫魅加載之後。因爲你打電話 _storyBoard.Begin();在GapBrowser_Loaded事件處理

+0

實際上,我正在使用插件來避免屏幕滾動,因爲我使用的WebBrowserHelper可以發送一個鏈接進行初始屏幕使用演練? –

+0

感謝孟先生,我已經通過本地代碼完成了它 –