Search code examples
iosgrid-layout

Implement the Android Market layout in an iOS view


I'm looking for an efficient way to implement the same kind of layout that the Android market.

Android Market Featured Apps

Right now I'm using a UITableView with custom cells. The data I'm sending from the server is something of the sort:

[
  {
    url: "app://url_of_content_in_the_app",
    image: "http://url of the featured image",
    height: 100
  }
},
{
  url: "app://url_of_content_in_the_app",
  image: "http://url of the featured image",
  height: 100
}
]

And I was thinking of updating the custom cell to support 2 or 3 buttons inside each cell, but I'm not sure this is the most efficient way to handle this. I was also thinking about a simple HTML page but I want the content to be cacheable easily.

One last point, the UITableView way only handles horizontal subdivisions such as:

_______
|__|__|
|_____|

I can't do something like:

_______
|  |__|
|__|__|

Solution

  • You can do something like your last example (three-way cell), just have a cell two units high that you present three cells in as separate views.

    Or at some point you may just decide putting views into a scroll view makes more sense, if there are not enough aspects of a UITableView you are making use of.