Redshirt
Redshirt

Reputation: 674

GridView inside ListView and recycling

I'm looking for advice on best practices for Using a gridview inside a linearlayout. I have a view that has a gridview at the bottom. With the rest of the info presented, the gridview only occupies about 1/3 or a little less of the screen. With two columns, there's less than 4 tiles visible on a lot of devices.

EX:

example

Now my question is, if I were to place the whole page in a vertical linearlayout, and disable the scrolling on the gridview. Having the whole page scroll. Is that a good design practice, and how does that affect the gridviews memory recycling. Would all tiles be in memory rather than perhaps 8 to account for the 4 that are visible.

Upvotes: 0

Views: 320

Answers (2)

Tale
Tale

Reputation: 76

I think the best solution for this kind of problem is: Use one ListView and many single row GridView for each row of ListView.

Upvotes: 1

Pulkit Sethi
Pulkit Sethi

Reputation: 1325

Are you expecting your gridview to recycle views if its not scrolling. Recycling of views comes into picture when an Adapterview scrolls, but you are already disabling that. How are you going to achieve the whole page scroll (by putting everything in a scrollview, or making the linear layout bounds bigger than the screen metrics. You know cant put an adpater view in a scrollview. Better approach is to allow gridview to scroll

Upvotes: 0

Related Questions