在代码中自动调整UIImageView

时间:2011-07-10 06:14:50

标签: iphone objective-c autosize

autosizing

我正在将自定义UITableViewCell从Interface Builder移动到代码中,但我不确定如何在上面的图像中复制自动调整大小。

self.autoresizingMask = (UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin);吗?

1 个答案:

答案 0 :(得分:14)

没有。自动调整夹到边缘并具有灵活的高度和宽度,因此它应该是,

self.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;