代码是制作水平滑动的recyclerview,但因项目个数少,所以不需要设置滑动,可用以下方法关闭
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this){
//禁止水平滑动
@Override
public boolean canScrollHorizontally() {
return false;
}
};
linearLayoutManager.setOrientation(RecyclerView.HORIZONTAL);
recyclerView.setLayoutManager(linearLayoutManager);
final BottomAdater bottomAdater = new BottomAdater(mbottomBarList);
recyclerView.setAdapter(bottomAdater);