Recyclerview加载图片的正确方式?

发布于 2022-09-02 23:38:46 字数 820 浏览 16 评论 0

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加载图片,这个时候如果想要更流畅的加载图片还需要采取什么方法。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深居我梦 2022-09-09 23:38:46

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文