0

Xamarin.Forms uygulamasında alt kısımda bir düğmem var. Bu düğme bir Windows 10 Cep telefonunda gizlenmiştir. Sayfamın boyutu mevcut boyuta uyarlanmakta olan bir ayar yok mu? Böyle bir durumda, navigasyon çubuğu gösteriliyorsa sayfamın yüksekliği azalır ve navigasyon çubuğu gizlenirse artar.Windows 10 Mobile'da alt gezinme çubuğunu kullanma

Gezinme çubuğunu programlı olarak saklamayı öneren çözümler gördüm. Örneğin.

ApplicationView.GetForCurrentView().TryEnterFullScreenMode(); 

Nerede yerleştirilmelidir? Ben OnLaunchedrootFrame.Navigate önce App.xaml.cs içine koydu. Uygulamayı yerel makinemde çalıştırırsam tam ekran olarak değiştirildi. Cep telefonunda navigasyon çubuğu gizlendi, ancak altta beyaz bir alan kaldı.

Ayrıca ben
ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Minimal; 

çalıştı ama farklı bir şey görmüyorum.

Bir geliştirici, altındaki içeriği gizlemeden gezinme çubuğunu nasıl ele geçirmelidir?

cevap

0

Bu sorunu gidermek için görünüyor:

ApplicationView.GetForCurrentView().SuppressSystemOverlays = true; 

sonucu, uygulamayı başlatırken gezinti çubuğu gösterilmez olmasıdır. Kullanıcı, gezinme çubuğunu hızlı bir şekilde gösterme olanağına sahiptir. Burada sayfa, istendiği gibi otomatik olarak yeniden boyutlandırılır.

ben OnLaunched yönteminde App.xaml.cs koydum: Böyle onLauched fonksiyonunda UWP için dosya App.xaml.cs yılında

ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible); 

:

protected override void OnLaunched(LaunchActivatedEventArgs e) 
{ 
    Frame rootFrame = Window.Current.Content as Frame; 

    // Do not repeat app initialization when the Window already has content, 
    // just ensure that the window is active 
    if (rootFrame == null) 
    { 
     // Create a Frame to act as the navigation context and navigate to the first page 
     rootFrame = new Frame(); 

     rootFrame.NavigationFailed += OnNavigationFailed; 

     Xamarin.Forms.Forms.Init(e); 

     if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 
     { 
      //TODO: Load state from previously suspended application 
     } 

     // Place the frame in the current Window 
     Window.Current.Content = rootFrame; 
    } 

    if (rootFrame.Content == null) 
    { 
     // When the navigation stack isn't restored navigate to the first page, 
     // configuring the new page by passing required information as a navigation 
     // parameter 
     ApplicationView.GetForCurrentView().SuppressSystemOverlays = true; 
     rootFrame.Navigate(typeof(MainPage), e.Arguments); 
    } 
    // Ensure the current window is active 
    Window.Current.Activate(); 
} 
0

de kullanabilirsiniz :

protected override void OnLaunched(LaunchActivatedEventArgs e) 
    { 
     if (System.Diagnostics.Debugger.IsAttached) 
     { 
      this.DebugSettings.EnableFrameRateCounter = true; 
     } 

     Frame rootFrame = Window.Current.Content as Frame; 

     // Do not repeat app initialization when the Window already has content, 
     // just ensure that the window is active 
     if (rootFrame == null) 
     { 
      // Create a Frame to act as the navigation context and navigate to the first page 
      rootFrame = new Frame(); 

      rootFrame.NavigationFailed += OnNavigationFailed; 

      Xamarin.Forms.Forms.Init(e); 

      if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 
      { 
       //TODO: Load state from previously suspended application 
      } 

      // Place the frame in the current Window 
      Window.Current.Content = rootFrame; 
     } 

     if (rootFrame.Content == null) 
     { 
      // When the navigation stack isn't restored navigate to the first page, 
      // configuring the new page by passing required information as a navigation 
      // parameter 
      ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible); 
      rootFrame.Navigate(typeof(MainPage), e.Arguments); 
     } 
     // Ensure the current window is active 
     Window.Current.Activate(); 
    } 

Bu, uygulamanızın görünür ar içinde kalmasını sağlar. Bu nedenle, alt gezinme çubuğundan herhangi bir yer paylaşımı olmadan.