.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,622 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In my .NET Maui application , I can check for Android or Windows and create View based on that check, however, I want to create views for Tablets that are different than Android Phone.
Here is my check so far.
public partial class App : Application
{
public App()
{
InitializeComponent();
#if ANDROID || IOS
MainPage = new NavigationPage(new MobileStartPage());
#else
MainPage=new NavigationPage(new DesktopStartPage());
#endif
}
}
How can I check for a Tablet?
You use the screen size and orientation to determine the layouts to use
You can use this platform independent MAUI code:
if (DeviceInfo.Idiom==DeviceIdiom.Tablet)
//DO SOMETHING