0
我在我的應用程序中有一個nestedscrollview。問題是滾動速度很慢。nestedscrollview內的Recyclerview - 慢滾動android 6?
的問題只發生在機器人6
我有這個在我的課:
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
recyclerView.setNestedScrollingEnabled(false);
XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<RelativeLayout
android:id="@+id/pro"
android:layout_width="match_parent"
android:layout_height="120dp"
android:background="?attr/colorPrimary"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<ImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/imageViewP"
android:layout_width="30dp"
android:layout_height="30dp"
android:cropToPadding="false"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/p2"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="#fff"
android:layout_below="@+id/pro"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:text="Sells"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4"
android:textStyle="normal|bold"
android:layout_marginRight="66dp"
android:layout_marginEnd="66dp"
android:layout_alignParentTop="true"
android:textSize="12dp"
android:layout_marginTop="5dp" />
<TextView
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/idFollowers"
android:gravity="center"
android:layout_below="@+id/textView4"
android:layout_alignLeft="@+id/textView4"
android:layout_alignStart="@+id/textView4"
android:layout_alignRight="@+id/textView4"
android:textSize="12dp"
android:layout_alignEnd="@+id/textView4" />
</RelativeLayout>
<ProgressBar
android:id="@+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
android:layout_below="@+id/p2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
任何想法如何獲得平滑滾動?爲什麼它在我的android 6中很慢?
因爲SwipeRefreshLayout消耗滾動已經 –