Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show Android SnackBar above keyboard?

Is it possible to show the Android Snackbar above the keyboard (as in Y coordinate, not layering)? The Snackbar currently gets hidden if the keyboard is shown, which is an undesirable behavior.

like image 211
fobbymaster Avatar asked Oct 15 '15 01:10

fobbymaster


People also ask

What is snack bar in Android?

Snackbar in android is a new widget introduced with the Material Design library as a replacement of a Toast. Android Snackbar is light-weight widget and they are used to show messages in the bottom of the application with swiping enabled. Snackbar android widget may contain an optional action button.

How do I change the snack bar position in flutter?

You can do this by placing a container inside the snackbar. Since snackbar can take any widget and you can change its background color to transparent, you can use a container with custom padding and borders to give an illusion of positioning.

How do I close the keyboard on Android?

HIDE_IMPLICIT_ONLY, 0); Here pass HIDE_IMPLICIT_ONLY at the position of showFlag and 0 at the position of hiddenFlag . It will forcefully close soft Keyboard.


1 Answers

Set

android:windowSoftInputMode="adjustResize" 

in the AndroidManifest.xml for the activity containing your snackbar

like image 53
giorgos.nl Avatar answered Oct 30 '22 17:10

giorgos.nl