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.
When viewing the Snackbar on versions prior to iOS 14, the background color of the Snackbar is missing.
Therefore, I focused on the parts that make up the Snackbar. The Snackbar container before the fix was
implemented with RoundedStackView, which inherited from UIStackView.
In versions before iOS14, the background color of UIStackView, which is the inheritor of RoundedStackView,
does not work. As of iOS 14, the UIStackView background color works. See below for this.
https://stackoverflow.com/questions/54273884/how-to-set-background-color-of-uiview-inside-of-uistackview
https://www.tutorialspoint.com/how-to-change-the-background-color-of-uistackview
https://useyourloaf.com/blog/stack-view-background-color-in-ios-14/
With all that said, RoundedStackView works fine on iOS 14 and above, but not on iOS 13 and below.
Therefore, I abolished RoundedStackView, which inherited from UIStackView.
Instead, I added a new RoundedView that inherits from UIView. The implementation of RoundedView
is based on the implementation of RoundedStackView.
The big difference is that the inheritance source changed from UIStackView to UIView.
Also changed Snackbar's container from RoundedStackView to UIStackView.
This is to prevent the background color and corners from being drawn twice for each of the
RoundedStackView and the newly added RoundedView that inherits the UIStackView.
From the above, it is no longer necessary to draw the background color and corners with the Draw
method, so I changed from RoundedStackView to UIStackView.
The newly added background color and RoundedView for drawing corners are adjusted in size
using AutoresizingMask.
Below is an excerpt of the changes. See source code diffs for more information.
[AlertView.macios.cs]
[RoundedView.cs]
Description of Change
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information
Below are the results of running before iOS 14 and after iOS 14.
[Case 1 (iOS 13.3.1)]
[Case 2 (iOS 13.3.1)]
[Case 1 (iOS 16.4)]
[Case 2 (iOS 16.4)]
Case 1 and Case 2 are the execution results below.
[Case 1]
[Case 2]