अंदर एक दृश्य की स्थिति मैं के लेआउट के साथ एक गतिविधि है ठीक करने के लिए कैसे:एक ViewPager और CoordinatorLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10dp"
android:scrollbars="vertical" />
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/download_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:src="@drawable/ic_btn_download" />
</RelativeLayout>
कैसे:
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="56dp"
android:layout_width="match_parent"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin"/>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="wrap_content"
app:tabIndicatorColor="@color/indicator"
app:tabMode="scrollable"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
टुकड़ा ViewPager
में लोड की एक लेआउट है क्या मैं टुकड़े के अंदर FloatingActionButton
की स्थिति (स्क्रॉलिंग को रोक सकता हूं) (यह अपने माता-पिता के साथ स्क्रॉल करता है) को ठीक कर सकता है?
ध्यान दें कि मैं गतिविधि लेआउट में FloatingActionButton
स्थानांतरित नहीं कर सका।
आप फ़्लोटिंगएक्शन बटन को अपने गतिविधि लेआउट में क्यों नहीं ले जा सकते? –