我在滚动时遇到问题,我的意思是滚动很快,但看起来卡顿,滚动完成前就停止了。以下是我定义的RecyclerView:
RecyclerView recyclerView=fragment.getRecyclerView();
LinearLayoutManager layoutManager = new LinearLayoutManager(fragment.getActivity(), LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(new DividerItemDecoration(fragment.getActivity(), LinearLayoutManager.VERTICAL));
ArrayList<InstaPostModel> rowListItems=getInstaPostListSample();
InstaPostAdapter rcAdapter = new InstaPostAdapter(rowListItems);
recyclerView.setAdapter(rcAdapter);
这里是onBindViewHolder
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
final InstaPostModel p = items.get(position);
context = holder.itemView.getContext();
Glide.with(context).load(R.mipmap.mee_small).into(holder.userPhoto);
Glide.with(context).load(R.drawable.post_image).into(holder.photo_content);
Glide.with(context).load(R.mipmap.love_gray_icon).into(holder.bt_like);
Glide.with(context).load(R.mipmap.comment_icon).into(holder.bt_comment);
Glide.with(context).load(R.mipmap.share_icon).into(holder.bt_share);
holder.userNameTextView.setText(p.getPosterUserName());
holder.postContent.setText(p.getText());
holder.post_date.setReferenceTime(p.getDate().getTime());
}
这里是 RecyclerView.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/qatar_now_posts_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
tools:context=".uis.fragments.home.QatarNowFragment"
/>
编辑: 我还在同一个片段中有底部导航栏,当滚动时它会显示出来。
编辑 2:这里是视频链接展示了卡顿的情况。我尝试了所有的解决办法,但没有一个有效果。我已经添加了所有的代码,请帮忙看看?