- 1 year ago
Ionic - Make the windows app run at fullscreen
To make an Ionic Windows app run in fullscreen mode, you can use the window
object provided by the underlying Cordova framework. Here's an example of how you can achieve this:
Install the Cordova plugin for managing the Windows platform if you haven't already done so:
csharpionic cordova platform add windows
Open the
MainPage.xaml.cs
file located in theplatforms\windows
directory.Add the following code inside the
MainPage
class constructor:csharppublic MainPage()
{
this.InitializeComponent();
// Make the app run in fullscreen mode
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
}
This code uses the
ApplicationView
class from theWindows.UI.ViewManagement
namespace to enter fullscreen mode when the app is launched.Build and run your Ionic app for the Windows platform:
arduinoionic cordova run windows
The app should now run in fullscreen mode when launched on a Windows device.
Please note that the above steps are specific to the Windows platform and assume you have already set up the Windows platform in your Ionic project. Additionally, fullscreen mode behavior may vary depending on the device and operating system version.
Refer to the official documentation for the Windows.UI.ViewManagement
namespace for more information on customizing the app's window and fullscreen behavior in a Windows environment.