您好,欢迎来到花图问答。
搜索
您的当前位置:首页阿里强大的 复杂布局 vlayout

阿里强大的 复杂布局 vlayout

来源:花图问答

源码使用 :

finalRecyclerView recyclerView = (RecyclerView) findViewById(R.id.main_view);   //recycleview 

final VirtualLayoutManager layoutManager =new VirtualLayoutManager(this);  //关键的 lanoutmanager  

final DelegateAdapter delegateAdapter = new DelegateAdapter(layoutManager, true);  //管理适配器  用来管理多个条目各自的adapter 

recyclerView.setAdapter(delegateAdapter);

final List<DelegateAdapter.Adapter> adapters = new LinkedList<>();  

 adapters.add(new SubAdapter(this, new LinearLayoutHelper(), 1) {
....

delegateAdapter.setAdapters(adapters); //最后将各个条目的适配器添加到管理适配器中 

Copyright © 2019- huatuowenda.com 版权所有 湘ICP备2023022495号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务