2017-09-05 33 views
0

我我RecyclerViewViewHolder布局我试图把一个android.widget.ScrollView滚动像这样这样的内容:什么不对这个RecyclerView ViewHolder滚动型的布局,不会滚动

<LinearLayout 
    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:layout_margin="8dp" 
    android:padding="4dp"> 

    <android.widget.ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fillViewport="true" 
     android:scrollbars="vertical"> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <TextView 
       android:id="@+id/title_text" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:padding="10dp" 
       android:text="SOME TEXT" 
       android:textStyle="bold"/> 

      <TextView 
       android:id="@+id/descr_text" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_below="@id/title_text" 
       android:padding="10dp" 
       android:text="SOME TEXT" 
       android:textStyle="bold"/> 

      <com.github.rahatarmanahmed.cpv.CircularProgressView 
       android:id="@+id/progress_view" 
       android:layout_width="40dp" 
       android:layout_height="40dp" 
       android:layout_centerInParent="true" 
       android:visibility="gone" 
       app:cpv_indeterminate="true"/> 
     </RelativeLayout> 
    </android.widget.ScrollView> 
</LinearLayout> 

的问题是什么也没有发生,我不能把它的滚动。 任何建议都会是炉排?

+0

你试过这些吗? (https://stackoverflow.com/questions/27083091/recyclerview-inside-scrollview-is-notworking) [this](https://stackoverflow.com/questions/33143485/recyclerview-inside- scrollview-not-scrolling-smooth) –

+0

你有没有尝试把高度放在dp中? – Vodet

回答

2

由于您的RecyclerView已经滚动,您可能需要NestedScrollview

+0

谢谢你的权利。我滚动,但非常慢,我必须轻松滑动才能使滚动移动 – Erik