Autoresizing is simple - think of it like a web page. Web content "flows", it takes up as much space as the browser window gives it. Autoresizing is the same. There are "masks" which tells UIKit how you want your content to adjust to different frame sizes.
So, for example, if you want your view to shrink or grow from the right side (if it were, for example, left-justified content like a table cell), you'd set the mask like this:
cell.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
Autoresizing also works like a bitwise-OR operation, so if you want it to grow from the right (as above) but also grow from the bottom, you'd "OR" the two together.
cell.autoresizingMask = (UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin);
In the case that this does not work for you (e.g. you want to put too much on the screen, and need to remove certain elements, etc, or you want to animate somehow differently than the default), consider using the pre-existing method calls in UITableViewCell. From the documentation:
- (void)willTransitionToState:(UITableViewCellStateMask)state
This will be called right before the cell changes state (normal->editing or the other), so if you need to do anything special to handle the animation to the editing state, this is your opportunity to do so. The docs state:
Subclasses of UITableViewCell can
implement this method to animate
additional changes to a cell when it
is changing state. UITableViewCell
calls this method whenever a cell
transitions between states, such as
from a normal state (the default) to
editing mode. The custom cell can set
up and position any new views that
appear with the new state. The cell
then receives a layoutSubviews message
(UIView) in which it can position
these new views in their final
locations for the new state.
Subclasses must always call super when
overriding this method.overriding this method.