Leanback VerticalGridFragment remove top spacing

后端 未结 4 1590
不知归路
不知归路 2021-02-20 09:46

I am using VerticalGridFragment to display items in a grid-like layout I don\'t need to show search or title and I want the rows to start from top of the screen without any marg

4条回答
  •  执念已碎
    2021-02-20 10:13

    Another way over this problem is to set the windowAlignment attributes of the VerticalGridView. Most notably ...

    verticalGridView.windowAlignment = BaseGridView.WINDOW_ALIGN_LOW_EDGE //this will remove the top margin
    verticalGridView.windowAlignmentOffset = 0
    verticalGridView.windowAlignmentOffsetPercent = 25f //find correct values for your case
    

提交回复
热议问题