मैं से नव Android Design Support Library की घोषणा की एक CoordinatorLayout
को लागू करने का प्रयास कर रहा हूँ काम नहीं कर रहा है और मैं नमूना here के अनुसार मेरी एक्सएमएल लेआउट में निम्न कोड का इस्तेमाल किया है:CoordinatorLayout
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways"/>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
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" />
हालांकि कार्रवाई बार जब मैं दृश्य को स्क्रॉल करता हूं तो छुपा नहीं जाता है। मैं यह नहीं समझ सकता कि यह क्यों काम नहीं कर रहा है।
संपादित करें: जहां तक मेरा जानकारी है ऐसा लगता है कि CoordinatorLayout
ListView/GridView/ScrollViews
साथ काम नहीं करता है और केवल RecyclerView
और NestedScrollView
साथ काम करता है। दुर्भाग्य से बस इन विचारों में से किसी एक पर स्विच करना मेरे लिए एक संभावना नहीं है इसलिए मैं अभी भी समाधान ढूंढ रहा हूं।
आप ListView/GridView और CoordinatorLayout API21 + के साथ उपयोग कर सकते हैं। –