4

Kartvizitler listesine sahip bir RecycleView'im var. RecycleView bir NestedScrollView içinde, çünkü katlanabilir bir üstbilgim var. Kaydırma hızlandırılmıyor, parmağımı ekrandan aldığımda kaydırmayı durduruyorum ve hızlandırılmış kaydırma yapmak istiyorum.Hızlandırılmış Kaydırma Geri Dönüşüm Görünümü

Bunlar benim düzenlerim.

CardView mizanpaj konteyneri.

<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/articles_card" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    card_view:cardCornerRadius="6dp" 
    card_view:cardUseCompatPadding="true" 
    card_view:cardPreventCornerOverlap="true" 
    android:layout_marginTop="0dp" 
    android:layout_marginBottom="0dp" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp" 
    card_view:cardElevation="5dp" 

    android:overScrollMode="always" 
    android:fadeScrollbars="true"> 

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

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:padding="10dp" 
      android:id="@+id/article_card_title" 
      android:textAppearance="?android:attr/textAppearanceLarge" 
      android:textColor="#000"/> 

    </LinearLayout> 

</android.support.v7.widget.CardView> 

Ve JAVA kodu:

 RecyclerView recyclerView = (RecyclerView)findViewById(R.id.articles_lista); 
     LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); 
     recyclerView.setLayoutManager(layoutManager); 
     ArticlesAdapter adapter = new ArticlesAdapter(Mock.getNoticias(1L), this); 
     recyclerView.setAdapter(adapter); 

teşekkürler.

DÜZENLEME: gibi Benim yeni düzen çalışıyor ve görünüyor

:

<RelativeLayout 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:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:context="newser.sab.com.newser.articles.ArticlesActivity2" 
    tools:showIn="@layout/app_bar_articles2"> 

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/articles_lista" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fadeScrollbars="true" 
     android:scrollbars="vertical" 
     /> 

</RelativeLayout> 
+0

bu satırı ekleyin yapmak da xml dosyasında bu satırı eklemek için herhangi bir çözüm? – AVEbrahimi

cevap

0

düzenini değiştirerek çalışıyor: ayarladığınız çünkü

<RelativeLayout 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:layout_width="match_parent" 
android:layout_height="match_parent" 
app:layout_behavior="@string/appbar_scrolling_view_behavior" 
tools:context="newser.sab.com.newser.articles.ArticlesActivity2" 
tools:showIn="@layout/app_bar_articles2"> 

<android.support.v7.widget.RecyclerView 
    android:id="@+id/articles_lista" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fadeScrollbars="true" 
    android:scrollbars="vertical" 
    /> 

0

01 içinde . Yani, daha hızlı kaydırma etkinleştirmek RecyclerView Etiketi

android:nestedScrollingEnabled="false" 

ya da dinamik olarak ben de aynı sorun var Java dosyası

recyclerView.setNestedScrollingEnabled(false); 
İlgili konular