How to add one section separator for Navigation Drawer in Android?

前端 未结 6 1684
粉色の甜心
粉色の甜心 2020-12-22 20:43

I have a navigation drawer like this image. I want to add a section separator (like the line separating Neptune). It seems simple but I can\'t find anything on the web that

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-22 21:14

    My hacky method is similar to Mostrapotski's.

    In my Layout for my custom adapter, I'm adding a horizontal separator at the beginning of each item and setting it's visibility to gone.

    For the elements that mark the beginning of a new group, I set their visibility to visible so that the separator shows up on top of it.

提交回复
热议问题