Recyclerview加载图片的正确方式?

item.xml

<ImageView
            android:id="@+id/movie_image"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
        <android.support.v7.widget.RecyclerView
            android:id="@+id/movie_recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
</RelativeLayout>

同时是使用new GridLayoutManager(getActivity(),2)以及glide加载图片,这个时候如果想要更流畅的加载图片还需要采取什么方法。

阅读 9.5k
1 个回答

监听滚动事件,滚动时不加载,或者,滚动速度超过一定值不加载。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题