Wednesday, August 4, 2010

Autoresize, programmatically

There are two ways to do this. One is the super-custom-I-don't-know-about-autoresizing way. Before I delete it (since it could be useful later, I wanted to document it here) It looks like this in a UIView subclass.

Init Method

didRotate method

Of course, this makes no sense at all when you can just do this (or do in IB, but that's not my point here):

The important advantage of the second one is that -- I think -- it actually readjusts DURING the rotation as well. That could be wrong.

No comments: