Key art image for Android ListView with Rounded Corners and Highlighting

Android ListView with Rounded Corners and Highlighting

Facebook Sync Contact Screenshot

I’ve just been asked for a helping hand about how to have a ListView with rounded corners, so here’s the solution.

In Android it’s fairly trivial to have a ListView with rounded corners on the first and last element. The problems comes when you want to be able to highlight the view, whether that be via press or with a focus.

The solution is nice and simple, the highlight applied by the system can be removed by setting the ListSelector color to transparent 

android:listSelector="#00000000"

If you want to see what’s behind the ListView, do the same with the background color

android:background="#00000000"

Finally, remove the footer divider

android:footerDividersEnabled="false"

Then in the background drawable of the list item, ensure it handles states to cope with being pressed and focused (same as you would do with a Button).

Found an issue?

All my posts are available to edit on GitHub, any fix is greatly appreciated!

Edit on GitHub