views:

55

answers:

1

What would be the recommended method to create a "table" like display (columns, rows, header and footer) using core-animation, which I can "build" using animations?

I've got my data to hand in an NSDictionary and I've started laying things out, but I feel I'm probably not doing it optimally; I'm creating nested sets of CALayers and working out its position of the previously-created layer's position and size.

At the moment it all feels very hacky, is taking much longer than I expected, and seems like its going to be a nightmare to animate using CABasicAnimation.

Any advice? If it helps, this isn't for the iPhone, but rather for the OS X desktop.

A: 

It seems as though the best way to accomplish this is to create a tree of CALayers in a similar way as mimicking tables in HTML using DIVs;

- "container" CALayer
  - "row" CALayer
    - "cell" CALayer

Using CAConstraint will help with ensuring these layers don't overlay their siblings.

digitala