- (CGSize)sizeThatFits:(CGSize)size;
return 'best' size to fit given size. does not actually resize view. Default is return existing view size
计算出最优size, 但是不会改变UIView的size,与参数size大小没有太大作用
- (void)sizeToFit;
calls sizeThatFits: with current view bounds and changes bounds size.
计算出最优size, 并且改变UIView的size
网友评论