I'm working on a new version of my video player in Lua. And I'm struggling with something, I feel, should be simpler.
I'm using a vertical gridview (1 column, multiple rows) for the menu. This gridview is drawn on top of a rounded rectangle. What I want to do is have the gridview drawn with a 10px margin on all sides. But vertically, I only want this margin to be there before the first item and after the last item of the list. This way, when scrolling, the content of the list should appear cut off right where the rounded rectangle is.
I'm aware of
gridview:setContentInset. But the problem is that this adds a permanent margin within the list. So when scrolling, the content of the list is cut off at 10px from the rounded rectangle.
I've tried using
setSectionHeaderHeight to create an invisible empty header section. And it does work for the top margin. But I haven't found a way to do the same for the bottom margin at the end of the list. (Adding a section empty section also creates an empty first row making the margin way too big.)
Is there a way to achieve this with the default SDK gridview? You can grab my code and try it for yourself on GitHub.