Skip to content

Commit

Permalink
Page platform-specifics on iOS (#2565)
Browse files Browse the repository at this point in the history
* Page platform-specifics on iOS.

* Add to TOC.

* Fix xrefs.

* Edits.
  • Loading branch information
davidbritch authored Oct 10, 2024
1 parent b463056 commit 5d27d22
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,10 @@
href: ios/platform-specifics/page-presentation-style.md
- name: NavigationPage bar translucency
href: ios/platform-specifics/navigation-bar-translucent.md
- name: Page home indicator visibility
href: ios/platform-specifics/page-home-indicator.md
- name: Page status bar visibility
href: ios/platform-specifics/page-status-bar-visibility.md
- name: Picker item selection
href: ios/platform-specifics/picker-selection.md
- name: Safe area layout guide
Expand Down
12 changes: 7 additions & 5 deletions docs/ios/platform-specifics/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "iOS platform-specifics in .NET MAUI"
description: "Learn how to consume iOS platform-specifics in .NET MAUI apps."
ms.date: 02/16/2023
ms.date: 10/10/2024
---

# iOS platform-specifics
Expand All @@ -20,22 +20,24 @@ The following platform-specific functionality is provided for .NET MAUI views on
- Controlling when item selection occurs in a <xref:Microsoft.Maui.Controls.Picker>. For more information, see [Picker item selection on iOS](picker-selection.md).
- Controlling whether a <xref:Microsoft.Maui.Controls.SearchBar> has a background. For more information, see [SearchBar style on iOS](searchbar-style.md).
- Enabling the `Slider.Value` property to be set by tapping on a position on the <xref:Microsoft.Maui.Controls.Slider> bar, rather than by having to drag the <xref:Microsoft.Maui.Controls.Slider> thumb. For more information, see [Slider thumb tap on iOS](slider-thumb.md).
- Controlling the transition that's used when opening a <xref:Microsoft.Maui.Controls.SwipeView>. For more information, see [SwipeView swipe transition mode](swipeview-swipetransitionmode.md).
- Controlling the transition that's used when opening a <xref:Microsoft.Maui.Controls.SwipeView>. For more information, see [SwipeView swipe transition mode on iOS](swipeview-swipetransitionmode.md).
- Controlling when item selection occurs in a <xref:Microsoft.Maui.Controls.TimePicker>. For more information, see [TimePicker item selection on iOS](timepicker-selection.md).

The following platform-specific functionality is provided for .NET MAUI pages on iOS:

- Controlling whether the detail page of a <xref:Microsoft.Maui.Controls.FlyoutPage> has shadow applied to it, when revealing the flyout page. For more information, see [FlyoutPage shadow](flyoutpage-shadow.md).
- Controlling whether the detail page of a <xref:Microsoft.Maui.Controls.FlyoutPage> has shadow applied to it, when revealing the flyout page. For more information, see [FlyoutPage shadow on iOS](flyoutpage-shadow.md).
- Controlling whether the navigation bar is translucent. For more information, see [Navigation bar translucency on iOS](navigation-bar-translucent.md).
- Controlling whether the page title is displayed as a large title in the page navigation bar. For more information, see [Large page titles on iOS](page-large-title.md).
- Disabling the safe area layout guide, which ensures that page content is positioned on an area of the screen that is safe for all iOS devices. For more information, see [Disable the safe area layout guide on iOS](page-safe-area-layout.md).
- Setting the presentation style of modal pages. For more information, see [Modal page presentation style](page-presentation-style.md).
- Setting the visibility of the homage indicator on a <xref:Microsoft.Maui.Controls.Page>. For more information, see [Home indicator visibility on iOS](page-home-indicator.md).
- Setting the status bar visibility on a <xref:Microsoft.Maui.Controls.Page>. For more information, see [Page status bar visibility on iOS](page-status-bar-visibility.md).
- Setting the presentation style of modal pages. For more information, see [Modal page presentation style on iOS](page-presentation-style.md).
- Setting the translucency mode of the tab bar on a <xref:Microsoft.Maui.Controls.TabbedPage>. For more information, see [TabbedPage translucent TabBar on iOS](tabbedpage-translucent-tabbar.md).

The following platform-specific functionality is provided for .NET MAUI layouts on iOS:

- Controlling whether a <xref:Microsoft.Maui.Controls.ScrollView> handles a touch gesture or passes it to its content. For more information, see [ScrollView content touches on iOS](scrollview-content-touches.md).

The following platform-specific functionality is provided for the .NET MAUI `Application` class on iOS:
The following platform-specific functionality is provided for the .NET MAUI <xref:Microsoft.Maui.Controls.Application> class on iOS:

- Enabling a <xref:Microsoft.Maui.Controls.PanGestureRecognizer> in a scrolling view to capture and share the pan gesture with the scrolling view. For more information, see [Simultaneous pan gesture recognition on iOS](application-pan-gesture.md).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions docs/ios/platform-specifics/page-home-indicator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Home indicator visibility on iOS"
description: "This article explains how to consume the iOS platform-specific that sets the visibility of the home indicator on a page."
ms.date: 10/10/2024
---

# Home indicator visibility on iOS

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

```xaml
<ContentPage ...
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.PrefersHomeIndicatorAutoHidden="true">
...
</ContentPage>
```

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

```csharp
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
...

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

The `Page.On<iOS>` method specifies that this platform-specific will only run on iOS. The
<xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.SetPrefersHomeIndicatorAutoHidden%2A?displayProperty=nameWithType> method, in the <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific> namespace, controls the visibility of the home indicator. In addition, the <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.PrefersHomeIndicatorAutoHidden%2A?displayProperty=nameWithType> method can be used to retrieve the visibility of the home indicator.

The result is that the visibility of the home indicator on a <xref:Microsoft.Maui.Controls.Page> can be controlled:

:::image type="content" source="media/page-home-indicator/home-indicator-visibility.png" alt-text="Home indicator visibility on an iOS page.":::

> [!NOTE]
> This platform-specific can be applied to <xref:Microsoft.Maui.Controls.ContentPage>, <xref:Microsoft.Maui.Controls.FlyoutPage>, <xref:Microsoft.Maui.Controls.NavigationPage>, <xref:Microsoft.Maui.Controls.Shell>, and <xref:Microsoft.Maui.Controls.TabbedPage> objects.
40 changes: 40 additions & 0 deletions docs/ios/platform-specifics/page-status-bar-visibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "Page status bar visibility on iOS"
description: "This article explains how to consume the iOS platform-specific that sets the visibility of the status bar on a Page."
ms.date: 10/10/2024
---

# Page status bar visibility on iOS

This iOS platform-specific is used to set the visibility of the status bar on a <xref:Microsoft.Maui.Controls.Page>, and it includes the ability to control how the status bar enters or leaves the <xref:Microsoft.Maui.Controls.Page>. It's consumed in XAML by setting the `Page.PrefersStatusBarHidden` attached property to a value of the <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.StatusBarHiddenMode> enumeration, and optionally the `Page.PreferredStatusBarUpdateAnimation` attached property to a value of the <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIStatusBarAnimation> enumeration:

```xaml
<ContentPage ...
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.PrefersStatusBarHidden="True"
ios:Page.PreferredStatusBarUpdateAnimation="Fade">
...
</ContentPage>
```

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

```csharp
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
...

On<iOS>().SetPrefersStatusBarHidden(StatusBarHiddenMode.True)
.SetPreferredStatusBarUpdateAnimation(UIStatusBarAnimation.Fade);
```

The `Page.On<iOS>` method specifies that this platform-specific will only run on iOS. The <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.SetPrefersStatusBarHidden%2A?displayProperty=nameWithType> method, in the <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific> namespace, is used to set the visibility of the status bar on a <xref:Microsoft.Maui.Controls.Page> by specifying one of the <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.StatusBarHiddenMode> enumeration values: `Default`, `True`, or `False`. The `StatusBarHiddenMode.True` and `StatusBarHiddenMode.False` values set the status bar visibility regardless of device orientation, and the `StatusBarHiddenMode.Default` value hides the status bar in a vertically compact environment.

The result is that the visibility of the status bar on a <xref:Microsoft.Maui.Controls.Page> can be set:

:::image type="content" source="media/page-status-bar-visibility/hide-status-bar.png" alt-text="Status bar visibility on an iOS page.":::

> [!NOTE]
> On a <xref:Microsoft.Maui.Controls.TabbedPage>, the specified <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.StatusBarHiddenMode> enumeration value will also update the status bar on all child pages. On all other <xref:Microsoft.Maui.Controls.Page>-derived types, the specified <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.StatusBarHiddenMode> enumeration value will only update the status bar on the current page.
The <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.SetPreferredStatusBarUpdateAnimation%2A?displayProperty=nameWithType> method is used to set how the status bar enters or leaves the <xref:Microsoft.Maui.Controls.Page> by specifying one of the <xref:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIStatusBarAnimation> enumeration values: `None`, `Fade`, or `Slide`. If the `Fade` or `Slide` enumeration value is specified, a 0.25 second animation executes as the status bar enters or leaves the <xref:Microsoft.Maui.Controls.Page>.

0 comments on commit 5d27d22

Please sign in to comment.