-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Conversation
334eddd
to
764516f
Compare
764516f
to
82751d0
Compare
@StephaneDelcroix Can you please resolve the conflicts? Thanks! |
82751d0
to
dee96d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Xamarin.Forms 4.8.0.1269 does not correctly render the iOS status bar area in Dark mode. In the dark mode the status bar area background remains white, while text color switches from black to white (as expected).
Expected behavior for the dark mode is black status bar area background. The issue is easily reproduced with a one page single grid with a 'Welcome to Xamarin Forms!' label. The page content changes correctly via AppThemeBinding applied to the grid background and the Label text color.
That problem did not exist in Xamarin Forms 4.7 builds with AppTheme_Experimental flag.
Android apps are not affected.
This right here might be needed for it to work properly:
|
Thank you for the suggestion, but it is not a solution. I slightly modified the test app to better illustrate the issue. XAML code of a test page producing the screenshot to follow: The page has a grid with no background set. One column, three rows. The middle row holds a BoxView and a Label to show the selected Theme and the Xamarin.Forms version. Grid rows 0 and 2 are rendered on the white background while the selected Theme is Dark. The status bar text is not visible because the status bar TextColor is White, as it should be in the Dark mode. Xamarin Forms 4.7 and prior do render page background according to the current Theme. A simple but silly looking 'solution' is to put following line into the ContentPage XAML section: The below XAML code will produce a correctly rendered page:
Looking closely at the recently updated Xamarin documentation https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/theming/system-theme-changes August 6, 2020: I see benefit in setting the Page themed background in XAML. It provides clear WYSISWYG control of the iOS status bar area appearance. |
So the problem with the background is currently making my app unusable (shot below is of a page with background color set to black on DarkMode, works fine in 4.7): This page has text set to white when phone is in Dark Mode, so I believe it is responding to the OS Theme, but somehow not setting the background color properly. Is there an open issue for this, or do I need to make one? |
Stefan, I can't tell from your screenshot if it is from iPhone or Android phone. Xamarin.Forms 4.7 with the experimental AppTheme flag loads Page with the background color matching the selected theme. |
Sorry, should have clarified. The screenshot above is on iOS. I set the code in XAML exactly as you describe. Background appears as black with the flag on 4.7, but the white screen shows when upgrading to 4.8. I can give specific more specific code when I'm at my workstation next, but the issue only appeared after I upgraded to 4.8. |
Description of Change
Drop the AppTheme Flag
Issues Resolved
none
API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
PR Checklist