Android Question CustomListView for even spacing?

techknight

Well-Known Member
Licensed User
Longtime User
I want to use a CustomListView for digital signage, and not for user interactivity so it wont scroll

I was wondering if its possible to evenly space items in the listview on-screen and continue to do that while adding/taking away items? For example if theres only 1 item, its centered. But if theres two, its evenly spaced, 3, and so on... Eventually theres a max point where it goes off the screen but thats fine because I can open up a listview beside it for additional items.

Anyone know how to do this and the math behind it? Thanks!
 

jahswant

Well-Known Member
Licensed User
Longtime User
For that you have to draw agrid and create corresponding layouts for every scenario. You can create 2-4 layouts depending on your needs.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
That seems painful. I wonder if theres a way to do this in code, because the whole thing is dynamic based on whats going on at the time.

The Divider Height in CustomListView looks like it would do what I need, but the problem is it wont let me set it programmatically, shows the property as read only.
 
Last edited:
Upvote 0
Top