private RecyclerView recyclerView;
private RecyclerView.Adapter myAdapter;
private List<String > mDatas;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//1.初始化化数据源
initDatas();
recyclerView=(RecyclerView)findViewById(R.id.rv);
//2.添加布局
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//3.添加适配器
myAdapter=new MyRVAdapter();
recyclerView.setAdapter(myAdapter);
//4.添加分割线,只有通过这种add方法才可以设置分割线
recyclerView.addItemDecoration(new DividerItemDecoration(this,DividerItemDecoration.VERTICAL_LIST));
}
-
Notifications
You must be signed in to change notification settings - Fork 6
设置不同LayoutManager,ItemDecoration , ItemAnimator实现令人瞠目的效果
beyondbycyx/RecycleView
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
设置不同LayoutManager,ItemDecoration , ItemAnimator实现令人瞠目的效果
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published