Erklärung
Das Problem scheint nicht auf iPad oder irgendwelche Android -Geräte zu erscheinen, aber auf allen iPhones, die das Bigger -Status -Bar am oberen Bereich haben. CommunityToolkit.Maui Version 9.0.3 Der StatusBar folpert.
Code: Select all
Code: Select all
Beim Googeln habe ich mehrere Einträge gefunden, die ein ähnliches Problem zu haben scheinen, und alle eine ähnliche Problemumgehung für die Übergabe des On-Appreaking wie folgt:
Code: Select all
protected override void OnAppearing()
{
base.OnAppearing();
#if IOS
// Workaround for iPhone 14: https://developer.apple.com/forums/thread/715417
if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
{
var window = UIKit.UIApplication.SharedApplication.Windows.FirstOrDefault();
var topPadding = window?.SafeAreaInsets.Top ?? 0;
var statusBar = new UIView(new CoreGraphics.CGRect(0, 0, UIScreen.MainScreen.Bounds.Size.Width, topPadding))
{
BackgroundColor = Colors.Green.ToPlatform()
};
var view = UIApplication.SharedApplication.Windows.FirstOrDefault(x => x.IsKeyWindow);
view?.AddSubview(statusBar);
}
#endif
}
< /code>
Leider addiert dies zu meinem Code nichts. IgnoresAfeArea = "True"