Xamarin.Forms Platform specific visual adjustments Using custom views


Example

You can create custom views that can be integrated to your page thanks to those adjustment tools.

Select File > New > File... > Forms > Forms ContentView (Xaml) and create a view for each specific layout : TabletHome.xamland PhoneHome.xaml.

Then select File > New > File... > Forms > Forms ContentPage and create a HomePage.cs that contains :

using Xamarin.Forms;

public class HomePage : ContentPage
{
    public HomePage()
    {
        if (Device.Idiom == TargetIdiom.Phone)
        {
            Content = new PhoneHome();
        }
        else
        {
            Content = new TabletHome();
        }

    }
}

You now have a HomePage that creates a different view hierarchy for Phone and Tablet idioms.