Home Indicator Visibility on iOS

Download Sample Download the sample

This iOS platform-specific sets the visibility of the home indicator on a Page. It's consumed in XAML by setting the Page.PrefersHomeIndicatorAutoHidden bindable property to a boolean:

<ContentPage ...
             xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
             ios:Page.PrefersHomeIndicatorAutoHidden="true">
    ...
</ContentPage>

Alternatively, it can be consumed from C# using the fluent API:

using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
...

On<iOS>().SetPrefersHomeIndicatorAutoHidden(true);

The Page.On<iOS> method specifies that this platform-specific will only run on iOS. The Page.SetPrefersHomeIndicatorAutoHidden method, in the Xamarin.Forms.PlatformConfiguration.iOSSpecific namespace, controls the visibility of the home indicator. In addition, the Page.PrefersHomeIndicatorAutoHidden method can be used to retrieve the visibility of the home indicator.

The result is that the visibility of the home indicator on a Page can be controlled:

Screenshot of home indicator visibility on an iOS page

Note

This platform-specific can be applied to ContentPage, MasterDetailPage, NavigationPage, and TabbedPage objects.