Earl Grey
Earl Grey

Reputation: 7466

Final layout rendering is animated while tableview is presented

I am using the tableview in a custom developed UI control.
The default frame of my tableView is {0,0,0,0}..So it's not visible..I am using the UIview's animation class methods with blocks (animateWithDuration:delay:..etc..) to animate this tableview "into the screen".The animation block contains only the frame.size change to {0,0, 320, 250}. So obviously, a few cells become visible as the frame of tableview is changed.

Further, I have a custom UIView with four UILabels in it. The labels are snapping to the bottom. In cellForRowAtIndexPath: I am adding this custom view to the cell's content view and I resize this custom view to match the content view frame.

customView.frame = cell.frame;
[cell.contentView addSubview:customView];

My problem is, as the cell's have different height, (resolved in heightForRowAtIndexPath)... the particular Custom view in particular cell is changing its frame, effectively moving the labels vertically down by a few pixels, during the main animation.

I want them to be in their place already when I am presenting the tableview.~

How to achieve this?

Upvotes: 1

Views: 110

Answers (1)

Avi Tsadok
Avi Tsadok

Reputation: 1843

You need to use autoresizingMask property of the cells, or:

You can create a custom table view cell, add those views, and handle that in the layoutSubviews of the cell.

Upvotes: 0

Related Questions