简体   繁体   中英

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? 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

So your options seems to be:

1) Fork RealmRecyclerView and add a getRecyclerView() method or similar so you can modify it as you want.

2) Use reflection to access the underlying RecyclerView.

3) Create an issue requesting the functionality.

4) Create your own implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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