2016-06-14 4 views
5

をスクロール、私は次のようなレイアウトを持っている:スクロールビューがずれていません。ゆっくり

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_marginTop="?android:attr/actionBarSize" 
    android:fillViewport="true"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 

     <LinearLayout 
      android:id="@+id/datatransfer_measure_list_layout_no_data" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

      <TextView 
       android:id="@+id/datatransfer_measure_list_textview_no_data" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="20dp" 
       android:layout_marginEnd="40dp" 
       android:layout_marginStart="40dp" 
       android:layout_marginTop="20dp" 
       android:gravity="center" 
       android:padding="5dp" 
       android:text="@string/measure_data_empty" 
       android:textColor="@color/textcolorprimary" 
       android:textSize="18sp" /> 

      <View 
       android:layout_width="match_parent" 
       android:layout_height="1dp" 
       android:layout_gravity="center" 
       android:layout_marginBottom="20dp" 
       android:layout_marginEnd="20dp" 
       android:layout_marginStart="20dp" 
       android:background="@android:color/darker_gray" 
       android:importantForAccessibility="no" /> 
     </LinearLayout> 

     <android.support.v7.widget.RecyclerView 
      android:id="@+id/datatransfer_measure_list_row_parent" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginBottom="15dp" 
      android:clipToPadding="false" 
      android:importantForAccessibility="no" 
      android:paddingBottom="5dp" 
      android:textColor="@color/textcolorprimary" /> 

     <Button 
      android:id="@+id/datatransfer_measure_list_button_send" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:layout_marginBottom="10dp" 
      android:layout_marginEnd="40dp" 
      android:layout_marginStart="40dp" 
      android:background="@drawable/custom_button_ok" 
      android:gravity="center" 
      android:padding="10dp" 
      android:text="@string/common_save" 
      android:textColor="@drawable/custom_button_positive_text_color" 
      android:textSize="20sp" /> 

     <Button 
      android:id="@+id/datatransfer_measure_list_button_reset" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:layout_marginBottom="20dp" 
      android:layout_marginEnd="40dp" 
      android:layout_marginStart="40dp" 
      android:background="@drawable/custom_button_cancel" 
      android:gravity="center" 
      android:padding="10dp" 
      android:text="@string/common_cancel" 
      android:textColor="@drawable/custom_button_negative_text_color" 
      android:textSize="20sp" /> 
    </LinearLayout> 
</ScrollView> 

は、私は基本的に、このレイアウトの三つの部分を持っています。最初に、データが設定されていないかどうかを示すテキストビューを含むレイアウト。データがあるときは見えなくなっています。

2番目の部分は、一部のデータが設定されている場合にのみ表示される私のrecyclerviewです。

最後の部分は2つのボタンです。このレイアウトの私の問題? スクロールが本当に遅いです。私は遅れやそのようなものを意味しません。私はちょうど小さな部分をスクロールすることができます。それは、私がそれを自動的にスクロールするようにビューを飛ばすことができる私の他のスクロールビューのようではありません。私はこのレイアウトとは何が違うのか、なぜ他のレイアウトでスクロールビューが異なるのか分かりません。スクロールビューのフリングなどをブロックするものがありますか?

答えて

13

RecyclerviewScrollViewと衝突しているため、スクロールがスムーズではありません。

recyclerviewのスクロールを無効にしてみます。

RecyclerView recyclerView = (RecyclerView)findViewById(R.id.datatransfer_measure_list_row_parent); 
recyclerView.setNestedScrollingEnabled(false) 
+1

それです。ありがとうございました! – Mulgard

関連する問題