के अंदर रखा गया है एक ऐसी योजना है जो मेरे आवेदन के दृश्य पदानुक्रम का वर्णन करती है।स्नैकबार एफएबी को नहीं ले जा रहा है जो फ्रेगमेंट
और कुछ एक्सएमएल
MainActivity
. CoordinatorLayout
. FrameLayout <- ContentFragment inserted here
app:layout_behavior="@string/appbar_scrolling_view_behavior"
. AppBarLayout
. Toolbar
ContentFragment
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="56dp"
android:layout_height="56dp"
android:src="@drawable/ic_plus_white_36dp"
android:layout_gravity="bottom|end"
android:layout_margin="15dp"
app:elevation="6dp"
app:pressedTranslationZ="12dp"/>
<TextView
android:id="@+id/hint_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/empty_dates_list"
android:padding="20dp"
android:textSize="20sp"
android:layout_gravity="center" />
</FrameLayout>
इस ग के साथ मैं SnackBar
बनाने स्तोत्र:
Snackbar snackbar = Snackbar.make(
mainActivity.getCoordinatorLayout(),
R.string.date_removed,
Snackbar.LENGTH_LONG);
मेरे समस्या कि fab
SnackBar
से ऊपर जा रहा है नहीं है कि मैं ContentFragment
मैं भी Snackbar
के लिए दृश्य के रूप में बिंदु fab
की कोशिश की में बनाने, लेकिन यह परिणाम नहीं लाया गया है।
होना एक CoordinatorLayout –