简体   繁体   中英

Android Studio Navigation Drawer ListView Divider

How can I only have one divider for the listview in Navigation Drawer? I tried using android:divider but that produces multiple lines! I only want a line after my 3rd item. How can I do that? (Sorry can't post image because of reputation)

You can't by default. One way you can do it as a workaround is by adding a conditional to your getView method, check if the position is 2 (third item) and add the divider to it -- maybe as an additional layout.

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