views:

51

answers:

1

Hello,

does anyone know of a UI Library for iOS, that acts like a horizontal UITabelView? I want to scroll cells from right to left and not from up to down.

Thank you

twickl

+2  A: 

I had a similar requirement: Horizontally scrolling tables in cells of a normal, vertically scrolling table.

My solution: I put a standard UIiew in the outer table's cell. This view had its transform property set to turn by 90°, serving as a "hinge", turning its contents to the side.

In the hinge view was another UITableView. Since it is contained in the turned view, it appears horizontally on the screen. The cells of this inner table contained another hinge view, turning their contents -90°, back to the upright orientation.

This might sound a little confusing, but it gives you all advantages of table views, in horizontal orientation. It's less confusing if you leave out the outer table view with their cells which are not needed in your case.

Edit: to answer comment

Performance was definitely great. Actually, performance was the major reason to switch to this approach. Table views are especially great for displaying huge data sets, since they only instantiate visible views (cells) and reuse them after being scrolled out. By itself a table view is quite light weight and very optimized for its purpose. My data sets where middle size, I'd say (about 100 items in both dimensions) and scrolling was perfectly smooth.

The other thing besides performance I was concerned about was touch handling. It went out that the table views (which derive from scroll views) always detected the gesture correctly (scrolling a scroll view in a scroll view is not easy to get right). If you swiped vertically the outer table view would handle the events, if you swiped horizontally the inner table gets all the events. I was quite impressed of how well the framework handled this non standard situation.

Nikolai Ruhe
So, you had one vertical Table and each cell in this table had a horizintal scrolling table in it? Does that perform well?I need more than one horizontal table and thought about using a UIScrollView and put those horizontal Tables on it but your aoproach sounds really interesting, if it performs well. How many Data didi you present?Thank Youtwickl
twickl