Skip to content
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

Snackbar layout looks different on iOS and Android #1901

Open
2 tasks done
raginmari opened this issue May 27, 2024 · 0 comments
Open
2 tasks done

Snackbar layout looks different on iOS and Android #1901

raginmari opened this issue May 27, 2024 · 0 comments
Labels
area/alerts Issue/Discussion/PR that has to do with Alerts bug Something isn't working unverified

Comments

@raginmari
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

Snackbars on iOS and Android look different: while the Android snackbar extends to the left and right edges of the screen, the iOS snackbar "hugs" its contents horizontally so that its width varies depending on the content. This difference in layout is unnecessary from a technical point of view and may conflict with people's designs which often request parity on Android and iOS.

Expected Behavior

Snackbars on both iOS and Android follow the same layout strategy and extend to the left and right edges of the screen.

Steps To Reproduce

  1. Open the solution of the reproduction sample
  2. Launch the app for Android and iOS
  3. Tap the button
  4. Observe the snackbar layout

Link to public reproduction project repository

https://github.com/raginmari/MauiCommunityToolkitSnackbarIssue

Environment

- .NET MAUI CommunityToolkit: 9.0.0
- .NET MAUI: 8.0.40
- OS: iOS 17.2

Anything else?

In order to fix the iOS snackbar layout, the horizontal constraints here have to be adjusted.

The reproduction sample contains a workaround for iOS (see MainPage.xaml.cs) which can be used to fix the issue in the short term (note: it relies on implementation details and may break in the future).

I personally expect snackbars to look and layout like they do on Android and would like iOS to follow suit. But this may be a point of personal preference and others may prefer the way iOS layouts the snackbar. Either way, I think that snackbars (and other components) should look as similar as possible if technically feasible.

Moreover, it can be argued that some the layout should be configurable:

  • should the snackbar "hug" its contents or extend to the edges?
  • should the snackbar always and exclusively anchor above its AnchorView or should there be an option to anchor it below the view? Maybe even inside the view?
  • should snackbars optionally fade in and out?
  • and much more...

This issue is supposed to create parity between Android and iOS and is not intended to discuss the configurability of the snackbar feature.

@raginmari raginmari added bug Something isn't working unverified labels May 27, 2024
@vhugogarcia vhugogarcia added the area/alerts Issue/Discussion/PR that has to do with Alerts label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerts Issue/Discussion/PR that has to do with Alerts bug Something isn't working unverified
Projects
None yet
Development

No branches or pull requests

2 participants