question

XavierPerseguers-6142 avatar image
0 Votes"
XavierPerseguers-6142 asked RobCaplan edited

Open page as a "card" or a "tab"

Dear community,

I'd like to mimic the opening of the page showing the form to create a new event in iOS calendar native application.

When tapping the "+" icon top right, the calendar page is not replaced by the new event form but goes behind it a bit like when having and switching tabs in a browser:

114951-img-d29fa2f01e1d-1.jpeg

My application is built around Shell and NavigationPage.


dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KyleWang-MSFT avatar image
0 Votes"
KyleWang-MSFT answered XavierPerseguers-6142 commented

Hi XavierPerseguers-6142,

Welcome to our Microsoft Q&A platform!

It's called "Modal Page". To achieve it, you only need to set the Page.ModalPresentationStyle bindable property to the UIModalPresentationStyle enumeration value "PageSheet".

 <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              x:Class="ModalPage.TestModalPage"
              xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
              ios:Page.ModalPresentationStyle="PageSheet">

And notice you need to call "PushModalAsync" to push this page.

 Navigation.PushModalAsync(new TestModalPage());

For more info, you can refer to the document: Modal Page Presentation Style on iOS.
Regards,
Kyle


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Many thanks @KyleWang-MSFT, I knew this looked kinda modal but couldn't find anything googling for it.

0 Votes 0 ·