Closed cris-m closed 3 months ago
Please be more detailed in your question and how it's related to MauiReactor
I am try to use SetUseSafeArea or IgnoreSafeArea in maui reactor component. I don't know how to do it. I was reading about it on Microsoft documentation https://learn.microsoft.com/en-us/xamarin/xamarin-forms/platform/ios/page-safe-area-layout
<ContentPage
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
Title="Safe Area"
ios:Page.UseSafeArea="true">
<StackLayout>
</StackLayout>
</ContentPage>
or
On<iOS>().SetUseSafeArea(true);
I want to know how to achieve this in MauiReactor
it's an attached property so something like this should work:
return ContentPage(
Grid(
)
)
.OnAppearing(OnCalcSafeAreaSize)
.OniOS(_ => _
.Set(MauiControls.PlatformConfiguration.iOSSpecific.Page.UseSafeAreaProperty, false));
This fix the issue about iOS UseSafeAreaProperty
but I am unable to use IgnoreSafeArea
on layout like Grid
or StackLayout
.
According to Microsoft documentation:
The Layout class defines a IgnoreSafeArea property that ensures that content is positioned on an area of the screen that is safe for all iOS devices. This property can be set to true on any layout class, such as a Grid or StackLayout, to perform the equivalent of this platform-specific.
how to use the IgnoreSafeArea
on the Grid
inside the ContentPage
?
return ContentPage(
Grid(
)
)
.OnAppearing(OnCalcSafeAreaSize)
.OniOS(_ => _
.Set(MauiControls.PlatformConfiguration.iOSSpecific.Page.UseSafeAreaProperty, false));
Hi, unfortunately, IgnoreSafeArea is not a dependency property so for now you have to set explicitly:
Grid(gridRef =>
{
if (gridRef != null)
gridRef.IgnoreSafeArea = true;
})
in future version I'll integrate it in MauiReactor so you'll be able to write something like:
Grid().IgnoreSafeArea(true)
I would like to know how to use
SetUseSafeArea
onContentPage
orIgnoreSafeArea
on layout likeGrid
,...