简体   繁体   English

将分隔器添加到领域回收器视图?

[英]Add divider to realm recycler view?

The realmRecyclerView contains no addItemDecoration() method.. is there any way for me to set a divider height for a realm recycler view? realmRecyclerView不包含addItemDecoration()方法..有什么方法可以设置领域回收者视图的分隔线高度吗? Or would it just make more sense for me to use the native recycler view? 还是使用本地回收者视图对我来说更有意义?

Right now that doesn't seem to be possible as RealmRecyclerView is just a FrameLayout that wraps the native RecyclerView, and that native view is not exposed: https://github.com/thorbenprimke/realm-recyclerview/blob/master/library/src/main/java/co/moonmonkeylabs/realmrecyclerview/RealmRecyclerView.java 现在这似乎是不可能的,因为RealmRecyclerView只是包装本机RecyclerView的FrameLayout,并且本机视图未公开: https : //github.com/thorbenprimke/realm-recyclerview/blob/master/library/的src /主/ JAVA / CO / moonmonkeylabs / realmrecyclerview / RealmRecyclerView.java

So your options seems to be: 因此,您的选择似乎是:

1) Fork RealmRecyclerView and add a getRecyclerView() method or similar so you can modify it as you want. 1)分叉RealmRecyclerView并添加getRecyclerView()方法或类似方法,以便您可以根据需要对其进行修改。

2) Use reflection to access the underlying RecyclerView. 2)使用反射来访问基础的RecyclerView。

3) Create an issue requesting the functionality. 3)创建一个请求功能的问题。

4) Create your own implementation. 4)创建自己的实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM