2016-01-15 13 views
7

के अंदर कोई रिलीज गति नहीं है मेरी गतिविधि में, मेरे पास के अंदर दो RecyclerView है। समस्या यह है कि जब मैं ScrollView स्वाइप/फ्लिक करता हूं, तो स्क्रॉलिंग तुरंत बंद हो जाती है। क्या गति या जड़ता को लागू करने के लिए ScrollView प्राप्त करने का कोई तरीका है, इसलिए स्क्रॉलिंग बंद होने से पहले कुछ मंदी हो रही है?स्क्रॉलव्यू

मेरे एक्सएमएल नीचे है:

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 

<ProgressBar 
    android:id="@+id/threadload_progress" 
    style="?android:attr/progressBarStyleLarge" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="8dp" 
    android:visibility="gone" /> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 

    <android.support.v7.widget.RecyclerView 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/subforums" 
     android:name="net.polunom.forum.fragments.ThreadFragment" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:layoutManager="LinearLayoutManager" 
     tools:context=".fragments.ThreadFragment" 
     tools:listitem="@layout/fragment_subforum"/> 

    <android.support.v7.widget.RecyclerView 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/threadlist" 
     android:name="net.polunom.forum.fragments.ThreadFragment" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:layoutManager="LinearLayoutManager" 
     tools:context=".fragments.ThreadFragment" 
     tools:listitem="@layout/fragment_thread"/> 

</LinearLayout> 
</ScrollView> 

उत्तर

13

मैं इसे समझ से बाहर! मुझे बस setNestedScrollingEnabled(false); को दो RecyclerView एस पर सेट करना था, और सब कुछ एक आकर्षण की तरह काम करना शुरू कर दिया था।

+0

यह मेरे लिए काम किया। मेरे पास एक ReapsingToolbarLayout के भीतर मेरा RecyclerView है, और यह काम किया। –

1

आप कर सकते हैं के साथ अपने को अक्षम एक्सएमएल में सीधे स्क्रॉल नेस्ट: android:nestedScrollingEnabled="false"

तो अपने एक्सएमएल देखने की तरह होगा:

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 

<ProgressBar 
    android:id="@+id/threadload_progress" 
    style="?android:attr/progressBarStyleLarge" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="8dp" 
    android:visibility="gone" /> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 

    <android.support.v7.widget.RecyclerView 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/subforums" 
     android:nestedScrollingEnabled="false" 
     android:name="net.polunom.forum.fragments.ThreadFragment" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:layoutManager="LinearLayoutManager" 
     tools:context=".fragments.ThreadFragment" 
     tools:listitem="@layout/fragment_subforum"/> 

    <android.support.v7.widget.RecyclerView 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/threadlist" 
     android:nestedScrollingEnabled="false" 
     android:name="net.polunom.forum.fragments.ThreadFragment" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:layoutManager="LinearLayoutManager" 
     tools:context=".fragments.ThreadFragment" 
     tools:listitem="@layout/fragment_thread"/> 

</LinearLayout> 
</ScrollView>