arjinmc / recyclerviewdecoration Goto Github PK
View Code? Open in Web Editor NEWa common tool class for itemdecoration of RecyclerView,support ninepatch image.
License: Apache License 2.0
a common tool class for itemdecoration of RecyclerView,support ninepatch image.
License: Apache License 2.0
每次都会出现
RecyclerViewLinearItemDecoration.Builder(mActivity).paddingStart(15f.dp2px())
.paddingEnd(15f.dp2px())
.thickness(1f.dp2px())
.color(getResColor(R.color.color_FAFAFA))
.create()
1.在draw时,int childrentCount = parent.getChildCount();需要处理if (childrentCount == 0) return;
2.Grid模式不支持设置水平、竖直space高度不同。
rv.setLayoutManager(new GridLayoutManager(getContext(), 2));
adapter = new Adapter();
rv.addItemDecoration(new RecyclerViewItemDecoration.Builder(getActivity())
.color("#ebebeb")
.thickness(6)
.create());
adapter.addHeaderView(getHeadView(rv, 2));
rv.setAdapter(adapter);
I'm using.
mRecyclerView.addItemDecoration(new RecyclerViewItemDecoration(RecyclerViewItemDecoration.MODE_HORIZONTAL, Color.RED,1,0,0));
,but no bottom line. please,How to add bttom line?
grid模式设置间隔较大时 item的宽高不等,间隔是相等的可是item的宽高不相等了
九宫格滚动起来有点卡,去掉边框线就感觉好了一些,难道是我的错觉吗
recyclerview添加了分割线 ,好像分隔线的高度并没有计算到recyclerview的高度里边去
看源码 如果thickness 值<= 2,直接=2, 对于我的需求来说 这个2 有点大了,最好是这个值 想设置多少就是多少 不要添加条件
发现了 GridLayoutManager 时的2个问题,
使用这个GridLayoutManager控制布局时
当只设置gridVerticalSpacing属性或marginVertical属性时,每个item的宽度和高度都是一致的
当同时设置或仅设置gridHorizontalSpacing属性或marginHorizontal属性时,都会出现第一列和最后一列的高度比中间列的高一些,同时宽度也是第一列和最后一列的比中间的列宽一些
每个参数的意思都是什么?文档没有说明,现在全靠猜
如果间隔设置的比较大,最后一列和前面几列的宽不相同,主要是因为recyclerview宽是固定的,没个item间隔相等最后导致最后一列的item宽出现问题,设置间隔较先时不明显,但是设置比较大的时候就会很明显
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.