Xamarin.forms: [Bug] Transparent Modal doesn't work on iOS

Created on 21 Aug 2020  路  2Comments  路  Source: xamarin/Xamarin.Forms

Description

When modally pushing a page with a transparent background over an existing page the background is transparent while the Navigation the page is animating, and then the background loses transparency.

Note this impacts the Prism 8 update to the DialogService as we are updating to use a Modal Page with a transparent background. See PR https://github.com/PrismLibrary/Prism/pull/2169/

Also while this may be related to #10861, I've opened this as a separate issue as I have tested with and without a NavigationPage in the mix and get the same results.

Steps to Reproduce

  1. Set App.MainPage = SomeRootPage
  2. Create new ContentPage

    • Set the Page Background to Color.Transparent

    • Give the content a mask layer with an opaque color

  3. Push the new page modally on the currently visible page

Expected Behavior

The Page background should be transparent with the opaque mask visible and showing the content of the underlying page

Actual Behavior

The Page background is transparent while the Navigation Animation is running and then loses transparency. If using PushModallyAsync(page, false) the new page simply is presented modally without a transparent background.

Basic Information

  • Version with issue: 4.8.0.1269
  • Last known good version: n/a
  • IDE: Visual Studio 2019 16.7.1
  • Platform Target Frameworks:

    • iOS: 13.20.2.2 (817b6f72a)

    • Android:

    • UWP:

  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

| Android | iOS |
|:--------:|:---:|
| transparent-modal-android | transparent-modal-ios |

Reproduction Link

https://github.com/PrismLibrary/Prism/tree/transparent-modals/e2e/Forms

Workaround

n/a

modal navigation 3 regression in-progress iOS 馃崕 bug

Most helpful comment

@dansiegel Using the PlatformSpecific that allows setting the ModalPresentationStyle:

On<iOS>().SetModalPresentationStyle(UIModalPresentationStyle.OverFullScreen);

Should allow you to use a transparent background.

All 2 comments

@dansiegel Using the PlatformSpecific that allows setting the ModalPresentationStyle:

On<iOS>().SetModalPresentationStyle(UIModalPresentationStyle.OverFullScreen);

Should allow you to use a transparent background.

thanks for the work around and fix in progress.

Was this page helpful?
0 / 5 - 0 ratings