Android Horizo​​ntal Recyclerview

时间:2016-09-18 06:25:44

标签: android listview android-viewpager android-recyclerview android-cardview

我在recyclerView中实现了水平滚动但是当我从右向左滑动时,下一张卡不会到达屏幕的中心位置,它会无限滚动。从左到右向右滑动应移动到下一张直接卡

Expected Output

Original Output

Adapter = new CardAdapter1(ProfileList, getActivity(), horizontal_recycler_view); 
final LinearLayoutManager horizontalLayoutManagaer = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false); 
horizontalLayoutManagaer.scrollToPosition(1); 
horizontal_recycler_view.setLayoutManager(horizontalLayoutMa‌​nagaer); 
horizontal_recycler_view.setAdapter(Adapter); 
horizontal_recycler_view.setHasFixedSize(true);`

1 个答案:

答案 0 :(得分:0)

似乎这有事情要做触摸事件。检查您的项目布局是否包含可能对触摸事件做出反应的ScrollView或类似元素。