2011-07-10 47 views
4

autosizing自動調整大小的UIImageView的代碼

我從界面生成器並轉換成代碼移動自定義的UITableViewCell,但我不能確定如何將自動調整大小上面的圖片中複製。

會是self.autoresizingMask = (UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin);

+1

給出的鏈接可能幫助: http://stackoverflow.com/questions/7754851/autoresizing -masks-編程-VS-interfact建設者 - 廈門國際銀行,筆尖 –

回答

14

號的自動調整大小夾到邊緣並具有靈活的高度和寬度,所以它應該是,

self.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;