Repository navigation
Closed
Labels
difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.kind/bugSomething isn't working
Description
Current behavior
We're facing an issue while customizing a ContentDialog to align it at the bottom of the screen in our UNO Platform app. Despite modifying its template for bottom alignment, we're encountering an unexpected margin or padding at the bottom, preventing the dialog from fully aligning with the screen's edge.
Expected behavior
ContentDialog should be aligned to the bottom of the screen, as it does on Android and Windows
How to reproduce it (as minimally and precisely as possible)
- Run App
- Press open dialog button
Workaround
No workaround
Works on UWP/WinUI
None
Environment
No response
NuGet package version(s)
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.2428" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.4.231219000" />
<PackageVersion Include="Uno.Core.Extensions.Logging.Singleton" Version="4.0.1" />
<PackageVersion Include="Uno.Extensions.Authentication" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Authentication.WinUI" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Configuration" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Hosting" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Hosting.WinUI" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Http" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Http.WinUI" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Http.Refit" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Localization" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Localization.WinUI" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Logging.OSLog" Version="1.7.0" />
<PackageVersion Include="Uno.Extensions.Logging.WinUI" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Navigation" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Navigation.WinUI" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Navigation.Toolkit.WinUI" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Reactive" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Reactive.WinUI" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Serialization" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Serialization.Http" Version="4.0.0" />
<PackageVersion Include="Uno.Extensions.Serialization.Refit" Version="4.0.0" />
<PackageVersion Include="Uno.Material.WinUI" Version="4.1.0" />
<PackageVersion Include="Uno.Dsp.Tasks" Version="1.2.8" />
<PackageVersion Include="Uno.Toolkit.WinUI" Version="5.1.5" />
<PackageVersion Include="Uno.Toolkit.WinUI.Material" Version="5.1.5" />
<PackageVersion Include="Uno.Resizetizer" Version="1.2.1" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="$(UnoVersion)" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageVersion Include="Uno.WinUI" Version="$(UnoVersion)" />
<PackageVersion Include="Uno.WinUI.Lottie" Version="$(UnoVersion)"/>
<PackageVersion Include="Uno.WinUI.RemoteControl" Version="$(UnoVersion)" />
<PackageVersion Include="Xamarin.Google.Android.Material" Version="1.9.0.2" />
<PackageVersion Include="Mapsui.Uno.WinUI" Version="4.1.2" />
<PackageVersion Include="Uno.Extensions.Reactive.Messaging" Version="2.5.11" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.2.0" />
<PackageVersion Include="Uno.WinUI.Svg" Version="$(UnoVersion)" />
<PackageVersion Include="SkiaSharp.Views.Uno" Version="2.88.6" />
<PackageVersion Include="Xamarin.Android.Google.BillingClient" Version="6.0.1.4" />
<PackageVersion Include="Xamarin.Android.Google.BillingClient.Ktx" Version="6.0.1.4" />
<PackageVersion Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.18" />
<PackageVersion Include="Uno.WinUI.DevServer" Version="$(UnoVersion)" />
<PackageVersion Include="Plugin.InAppBilling" Version="7.1.0" />
<PackageVersion Include="Microsoft.Maui.Essentials" Version="8.0.3" />
Affected platforms
iOS
IDE
Visual Studio 2022
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response
Metadata
Metadata
Assignees
Labels
difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.kind/bugSomething isn't working
Activity
kazo0 commentedon Mar 19, 2024
Hey @mcocaroUX,
I have made progress on this and identified it as an issue in the calculation of the dialog placement relative to the "unsafe" areas of the screen, especially on mobile when we have large display cutouts and things like the Dynamic Island on iOS. This should also be a problem on Android but you would see it less often.
On Android, if I had a device with a large camera notch and allowed the app content to display beneath the status bar, we would end up with the same result as you are seeing on iOS:
Once I have a stable fix for this I will update you, should be very soon. But, keep in mind, the logic will still be in place to ensure that the ContentDialog content will not display within the "unsafe" areas of the screen, this means there will still be some spacing between the bottom of the screen on iOS/Android, since that area is reserved for the navigation gesture area. So what you will expect to see is something like this:
The actual dialog content is what you see in Yellow, containing the title and message. The Red area with Yellow border outline is just a background color I set in your style to better highlight the bounds of the control
mcocaroUX commentedon Mar 19, 2024
Sounds good! thank you @kazo0
[-][iOS] Aligning ContentDialog to Screen Bottom[/-][+]Aligning ContentDialog to Screen Bottom[/+]kazo0 commentedon Mar 20, 2024
@mcocaroUX PR is up and I will backport it as well. What version of Uno are you using? latest stable?
mcocaroUX commentedon Mar 20, 2024
Thanks @kazo0. Yes we are using latest stable (5.1.87)