dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.04k stars 1.73k forks source link

[MacOS] Entry Causing UIView to apply SafeAreaInsets during focus #22960

Open cgp1976 opened 3 months ago

cgp1976 commented 3 months ago

Description

Basically, I have configured the app to enabled fullSizeContentView and set the titlebar to hidden using the following;

mainpage.cs

var scene = UIKit.UIApplication.SharedApplication.ConnectedScenes.ToArray().FirstOrDefault(); var windowScene = (UIKit.UIWindowScene)scene;

windowScene.Titlebar.TitleVisibility = UITitlebarTitleVisibility.Hidden; windowScene.Titlebar.ToolbarStyle =UITitlebarToolbarStyle.UnifiedCompact; windowScene.Titlebar.AutoHidesToolbarInFullScreen=true;

mainpage.xaml

xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" ios:Page.UseSafeArea="False"

MauiProgram.cs

Microsoft.Maui.Handlers.LayoutHandler.Mapper.AppendToMapping("LayoutHandler.IgnoreSafeArea", (h, v) => { if (v is Layout layout) layout.IgnoreSafeArea = true; });

everything seem ok until I tried to add one entry control at the very top of the page. The safeAreaInset will kicks in when I click on the entry (Top=32, the rest all 0) and this will caused the page to leave a gap and the top of page.

MauiApp1.zip

Initial View image

After Clicking Entry image

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

9.0.0-preview.4.10690

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

No response

Did you find any workaround?

nil

Relevant log output

nil
github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

ninachen03 commented 3 months ago

Verified this issue on VS Code 1.90.0 (9.0.0-preview.4.1069 & 9.0.0-preview.1.9973). Can repro it with sample project. image