Display Snackbar below android.support.v7.widget.Toolbar
See original GitHub issueIs there a way to display the TSnackbar under the android Toolbar? Your sample code contains a coordinator layout, but I use a different activity main layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar"
style="@style/AppTheme.CustomToolbar"/>
<FrameLayout
android:id="@+id/fragment_placeholder"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
fragment_placeholder is obviously a layout where I add fragments.
The problem is that it doesn’t matter what view I provide to TSnackbar.make, the snackbar always appears over my Toolbar, but below the notification panel (where the battery and other stuff is displayed, as you describe in the README). I want to display the snackbar below the Toolbar so it overlays a bit of “fragment_placeholder”, but nothing from “tool_bar”. I hope this is possible.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
android - Show a SnackBar on the top (below of the toolbar)
Show a SnackBar on the top (below of the toolbar) ... I'm trying to show a SnackBar on top below of the ToolBar...
Read more >Android Snackbar Example Tutorial - DigitalOcean
A code snippet to display a basic android Snackbar is shown below. ... AppCompatActivity; import android.support.v7.widget.Toolbar ...
Read more >Android Material Design and the Design Support Library
This tutorial gives an overview of Material Design UI components together with example code for using them in your application.
Read more >Snackbars - Material Design
The Snackbar class provides static make methods to produce a snackbar configured in the desired way. These methods take a View, which will...
Read more >Material Design with the Android Design Support Library
The library includes a navigation drawer view, floating labels for editing text, a floating action button, snackbar, tabs and a motion and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same issue, it was solved by simply wrapping my fragment layout in a coordinatorlayout. So, originally, my fragment layout top most view was a relative layout, I wrapped this in a coordinatorlayout and then attached the snackbar to the relativelayout, sorted. Good luck
I’ve updated the readme with the coordinatorlayout tip. Thanks for mentioning it