Android Code Snippet Programaticaly suppress divider in customlistview

Hi everybody

I wasted time unsuccessfully to suppress divider seted in designer for customlistview : I wanted the last items to be without. And finally the solution is quite simple. As I am not the only one to search for, here are the 2 «magic» lines where clv is the name of your customlistview of course :
Annihilating divider:
... Just after having added a new item...
clv.GetPanel(clv.Size-1).Parent.Top    = clv.GetPanel(clv.Size-1).Parent.Top - 1dip
clv.GetPanel(clv.Size-1).Parent.Height = clv.GetPanel(clv.Size-1).Parent.Height + 1dip
Just change the value 1dip with the height of your divider set in designer
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…