2015-11-29 9 views
5

मुझे वरीयता फ़्रेगमेंट और CollapsingToolbarLayout के साथ कोई समस्या है।वरीयता फ़्रेगमेंट कोई स्क्रॉल CollapsingToolbarLayout

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:id="@+id/mainLayout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context=".activities.base.BaseActivity"> 

<android.support.design.widget.AppBarLayout 
    android:id="@+id/appbarLayout" 
    android:layout_width="match_parent" 
    android:layout_height="@dimen/nav_header_height" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> 

    <android.support.design.widget.CollapsingToolbarLayout 
     android:id="@+id/ctlLayout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_scrollFlags="scroll|exitUntilCollapsed"> 

     <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      android:minHeight="?attr/actionBarSize" 
      android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
      app:layout_collapseMode="pin" 
      app:popupTheme="@style/ThemeOverlay.AppCompat.Light"></android.support.v7.widget.Toolbar> 

    </android.support.design.widget.CollapsingToolbarLayout> 

</android.support.design.widget.AppBarLayout> 

<FrameLayout 
    android:id="@+id/fragment_container" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    android:nestedScrollingEnabled="true"/> 

<android.support.design.widget.FloatingActionButton 
    android:id="@+id/fabFav" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginRight="85dp" 
    android:src="@android:drawable/ic_menu_save" 
    app:layout_anchor="@id/appbarLayout" 
    app:layout_anchorGravity="bottom|right|end" 
    android:visibility="gone" /> 

<android.support.design.widget.FloatingActionButton 
    android:id="@+id/fabShare" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_margin="@dimen/fab_margin" 
    android:src="@android:drawable/ic_menu_share" 
    app:borderWidth="0dp" 
    app:layout_anchor="@id/appbarLayout" 
    app:layout_anchorGravity="bottom|right|end" 
    android:visibility="gone" /> 

<fragment 
    android:id="@+id/search_fragment" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:name="com.eventum.raedictionary.fragments.SearchFragment" 
    tools:layout="@layout/fragment_search"/> 

समस्या है जब मैं एक PreferenceFragment स्क्रॉल काम नहीं करता है के साथ, लेकिन एक सामान्य टुकड़ा ठीक से काम करता साथ Framelayout बढ़: मैं एक आधार लेआउट है।

 BaseSettingFragment settingsFragment = new BaseSettingFragment(); 

     fragmentTransaction = getFragmentManager().beginTransaction(); 

     fragmentTransaction.setCustomAnimations(R.transition.fade_in, R.transition.fade_out); 

     fragmentTransaction.replace(R.id.fragment_container, settingsFragment); 

     fragmentTransaction.commit(); 

मुझे इस समस्या के लिए कोई समाधान नहीं मिला है, क्या कोई मेरी मदद कर सकता है?

अग्रिम धन्यवाद।

पीडी: मेरी अंग्रेजी के लिए खेद है।

उत्तर

6

PreferenceFragmentListView, जो CollapsingToolbarLayout के लिए आवश्यक नेस्टेड स्क्रॉल एपीआई का समर्थन नहीं करता पर आधारित है। इसके बजाय आप Preference Support Library और PreferenceFragmentCompat का उपयोग कर सकते हैं, जो RecyclerView पर आधारित है और आवश्यक नेस्टेड स्क्रॉलिंग API का समर्थन करता है।

+0

बहुत बहुत धन्यवाद .... यह पूरी तरह से काम करता है !!! – Buntupana

संबंधित मुद्दे