Search code examples
androidlistviewwidthdivider

How to set width of ListView divider?


How can I set the width of my custom ListView divider, in order to have it smaller than my row width?


Solution

  • Make a 9 patch png that has transparent pixels on the left and right. For example, a 53x4 .9.png that has 25 transparent pixels either side (+ pixels to 9patch it) would stretch the 1 pixel out so there is 25 pixels either side of it.