-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Snackbar background color not working on iOS 13.3.1. #1160
Comments
I analyzed the source code and found out why the background color does not change. The site below says that Community Toolkit is supported on iOS 10 or higher, https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/ At least some of Snackbar's options don't work with the current structure. |
By writing the following after calling AlertView.Setup() in the Show method of the Alert class,
|
Similarly, the CornerRadius of the four corners cannot be specified, but the following is also possible.
If I were to add the above code, it would be after the AlertView.Setup() call in the Alert class. In full swing, it is necessary to mask the four corners using UIBezierPath and CAShapeLayer. |
@cat0363 Thank you for the investigation. Would you like to contribute and create a bug fix PR? |
Hi, @VladislavAntonyuk |
Hi, @VladislavAntonyuk [Alert.macios.cs] <= Modify
[RoundedView.cs] <= Add namespace CommunityToolkit.Maui.Core.Views;
Below is the execution result on iOS 13.3.1. (iPad) [Case 1]
[Case 2]
Below is the execution result on iOS 16.4. (iPhone) [Case 1] [Case 2] Below is the result before correction on IOS 16.4. (iPhone) [Case 1] [Case 2] iOS 14 and above look the same before and after the fix. In order to reduce the impact, it may be better to run it only before iOS 14. Could you please confirm the following points?
Could you please check if there are any problems? |
Thank you for detailed response. |
Hi, @VladislavAntonyuk I partially copied and modified the CommunityToolkit source to study the solution. If I download the complete The iOS versions that I can check on the simulator and the actual machine are as follows. iOS 13.3.1 I will report back here once the verification is complete. This is the current code. The code further changes depending on whether the Draw method of RoundedStackView [AlertView.macios.cs] <= Modify
[RoundedView.cs] <= Add
Thank you. |
Hi, @VladislavAntonyuk |
Hi, @VladislavAntonyuk Given the above, below is the solution I wrote. [AlertView.macios.cs] <= Modify
[RoundedView.cs] <= Add
[RoundedStackView.macios.cs] <= Delete Below is the execution result on iOS 13.3.1. (iPad) [Device] [Case 2] Below is the execution result on iOS 13.7. (iPhone) [Simulator] [Case 2] Below is the execution result on iOS 14.5. (iPhone) [Simulator] [Case 2] Below is the execution result on iOS 16.4. (iPhone) [Device] [Case 2] The truncated messages are due to the width of the simulator. The omission of messages is irrelevant to the presence or absence of corrections. Same for iOS 14.5 before the fix. Operation verification on iOS 15.5 could not be verified by the end of today |
Below is the execution result on iOS 15.5. (iPhone) [Simulator] [Case 2] Below is the execution result when ActionButton is added. [iOS 13.3.1] [iOS 13.7] [iOS 14.5] [iOS 15.5] [iOS 16.4] At least on the version of iOS I was able to verify, it worked as intended. |
Additional Information: If this fix doesn't seem to be a problem, I'll create a bug fix PR, what do you think? |
I will appreciate if you create a PR. Thank you! |
Hi, @VladislavAntonyuk |
Thank you for taking the time to resolve this issue. |
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
Even if you specify the Snackbar's BackgroundColor, it will not be
colored in iOS 13.3.1. Works as expected on iOS 16.3.
Expected Behavior
Even in iOS 13.3.1, if Snackbar's BackgroundColor is specified,
it must be colored.
Steps To Reproduce
Please follow the steps below to reproduce.
iOS 13.3.1 displays a snackbar with a transparent background color.
Link to public reproduction project repository
https://github.com/cat0363/MauiComm-IssueSnackbar.git
Environment
Anything else?
I tried to show a snackbar with background color set like below, but the
background color doesn't work on iOS 13.3.1.
The above code works as intended on Android, but not on iOS 13.3.1.
In iOS 13.3.1, the background color is displayed as transparent,
but in iOS 16.3, it is displayed with the specified background color.
[iOS 13.3.1]
[iOS 16.3]
The text was updated successfully, but these errors were encountered: