Reputation: 5962
I recently came to know about the support design library for android with build version 22.2.0. In that I am very much impressed with most of the custom views which is easy to use. But whereas Customization of those as concern I am completely stuck up with the solutions. In that one of the major portion I am completely struggling is SnackBar.
I am using following code to display SnackBar in my Activity:
Snackbar.make (view,"Success",Snackbar.LENGTH_SHORT).show ();
Gradle Build library:
compile 'com.android.support:design:22.2.0'
Everything works awesome but what i need is to show snackbar from top to bottom instead of default bottom to top property. Please anyone kindly help with your solutions. Thanks in advance
Upvotes: 0
Views: 8258
Reputation: 11154
you need to set the layout gravity of the views, add new animations for slide-up/down.
check my answer from here https://stackoverflow.com/a/33333521/1031297
Upvotes: 1
Reputation: 61
According to the documentation :
Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.
I can't have a look to the Snackbar source code now, but maybe you can try to extend the Snackbar class and override the show() method or another one to fit your needs.
Upvotes: 3