Asim Panra
Asim Panra

Reputation: 51

Android Leanback: Reduce rows spacing in RowsSupportFragment

I'm trying to create a vertical list of selectable items in Android TV using Leanback RowsSupportFragment. There seems to be some default spacing, shown as black color in attachment, between rows here. I need to remove this spacing. I've looked into some dimens attributes but they are setting the spacing globally while I only require it on a particular screen. How this may be achieved?

enter image description here

Upvotes: 3

Views: 1231

Answers (1)

burakk
burakk

Reputation: 1291

Try using the setVerticalMargin (or setItemMargin ?) methods of the VerticalGridView widget in RowsSupportFragment:

getVerticalGridView().setVerticalMargin(25);

Upvotes: 1

Related Questions