private RecyclerView mRlv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
}
private void initView() {
mRlv = (RecyclerView) findViewById(R.id.rv_main);
//添加下面这条就可以给RecyclerView列表添加分割线,添加位置请按自身情况去放置。
//分隔线
mRlv.addItemDecoration(new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL));
}
===================================
这个方式够简单吧?