2011-04-04 73 views

回答

5

一般而言,UIImageView不會響應圖像的大小而調整大小。會發生什麼,是UIImageView不會剪輯內容,以便您看到圖像超出邊界框。

你可以使UIImageView調整大小以適應入禁區的圖像,通過做

imageview.contentMode = UIViewContentModeScaleAspectFit; 

或填補框:

imageview.contentMode = UIViewContentModeScaleAspectFill; 

,或者你可以讓它裁剪圖像:

imageview.clipsToBounds = YES;