Maui: [BUG] Snackbar background color not working on iOS 13.3.1.
Is there an existing issue for this?
- I have searched the existing issues
Did you read the “Reporting a bug” section on Contributing file?
- I have read the “Reporting a bug” section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
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.
- Press the Show Snackbar button on MainPage.
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
- .NET MAUI CommunityToolkit: 5.1.0
- OS: Windows 11 Build 22621.1555
- .NET MAUI: 7.0.81
- Target Device OS: iOS 13.3.1
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.
// Create Snackbar
var snackbar = Snackbar.Make(
"This is test message.",
action: null,
actionButtonText: string.Empty,
duration: new TimeSpan(0, 0, 0, 0, 3500),
visualOptions: new CommunityToolkit.Maui.Core.SnackbarOptions() {
BackgroundColor = Colors.Red,
TextColor = Colors.White
},
anchor: null
);
// Display Snackbar
snackbar.Show();
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]
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (12 by maintainers)
Commits related to this issue
- Fixed code for Issue #1160 — committed to cat0363/Maui by cat0363 a year ago
- Fix Issue #1160 (#1234) * Fixed code for Issue #1160 * Changed how to refer to Subviews * Revert and deprecate RoundedStackView — committed to CommunityToolkit/Maui by cat0363 a year ago
I will appreciate if you create a PR. Thank you!
Hi, @VladislavAntonyuk I’m busy migrating my app from Xamarin.Forms to .NET MAUI, so it would be helpful if someone could take care of this issue. I can investigate and provide information, but I’m sorry that I can’t help you. CornerRadius support isn’t perfect in my code, so I need to do more research. If I find out anything additional, I’ll provide that information in this issue. I’m still fumbling, so I’ll let you know when I can contribute to a bug fix PR.