I am trying to get snackbar below 3 tabs .I have inflated a fragment and implemented coordinator layout within that.I am unable to display snackbar on top below tabs.And getView() displays snackbar at the bottom above floating button and this code How to show Snackbar at top of the screen displays snackbar right on top which I don't want. How to make snackbar display below tabs in fragment?
Code:
Snackbar snackbar = Snackbar
.make(coordinatorLayout_snackbar, “Snackbar”, Snackbar.LENGTH_INDEFINITE)
.setAction(“click”, new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.e(TAG, "button clicked");
}
});
snackbar.show();
xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:id="@+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinatorLayout_snackbar”
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true">
</android.support.design.widget.CoordinatorLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>