Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using StatusBarBehavior changes the color of the status bar, but the size of the status bar does
not change when the screen is rotated. This PR fixes an issue where the size of the status bar
is not updated when the screen is rotated.
Description of Change
To solve this problem, I monitored the Page's SizeChanged event and updated the size of the
StatusBar when the screen was rotated. OnAttachedTo of StatusBarBeahvior registers the
SizeChanged event, and OnDetachedFrom unregisters the SizeChanged event. I modified it to
call the newly added UpdateBarSize method within the Page's SizeChanged event.
[StatusBarBehavior.shared.cs]
I defined the UpdateBarSize method for Shared and the PlatformUpdateBarSize method for each platform.
[StatusBar.shared.cs]
[StatusBar.ios.cs]
[StatusBar.android.cs]
[StatusBar.macos.cs]
[StatusBar.net.cs]
[StatusBar.tizen.cs]
[StatusBar.windows.cs]
Platforms other than iOS are outside the scope of this issue, so I implemented it to throw a NotSupportException.
Since I do not have a simulator prior to iOS 13 in my execution environment,
I have not been able to confirm the operation on versions prior to iOS 13.
Is there anyone who can verify that the following works?
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information
Below is the execution result.
[iOS 16.4]
iPad.10th.generation.iOS.16.4.2023-06-15.13-01-13.mp4
[iOS 15.5]
iPad.9th.generation.iOS.15.5.2023-06-15.13-18-40.mp4
[iOS 14.5]
iPad.8th.generation.iOS.14.5.2023-06-15.13-58-52.mp4
[iOS 13.7]
iPad.7th.generation.iOS.13.7.2023-06-15.14-39-01.mp4
The video is a recording of the following steps.
The color of the status bar is changed at both the page transition source and the page transition
destination, but the finally changed status bar color is retained, and only the size of the status bar is
changed after the rotation operation.