UIView详解三

UIView详解3Asks the view to calculate and return the size that best fits its subviews.- (CGSize)siz

UIView详解3

Asks the view to calculate and return the size that best fits its subviews.

- (CGSize)sizeThatFits:(CGSize)size
Parameters
size

The current size of the receiver.

Return Value

A new size that fits the receiver’s subviews.

5. – sizeToFit

Resizes and moves the receiver view so it just encloses its subviews.

- (void)sizeToFit得到最适合当前字数的尺寸,