2011-11-04 27 views

回答

0

UIImageView你只需要設置相應的contentMode拉伸的圖像。

您可以設置的UIImageView是在屏幕的大小和設置內容模式類似如下

3個選項

// assume iv is an UIImageView the size of screen 
// First option stretches your image to the size of the screen 
[iv setContentMode:UIViewContentModeScaleToFill]; 
// Second option scales your image without changing aspect ratio to the largest possible size such that the whole image fits 
[iv setContentMode:UIViewContentModeScaleAspectFit]; 
// Third option scales your image without changing aspect ratio to the smallest possible size such that the screen is covered (potentially clipping some of your image) 
[iv setContentMode:UIViewContentModeScaleAspectFill]; 
+0

這很好,謝謝 –

相關問題