我創建了一個包含高分辨率圖像的UIImageView。問題是該圖像的分辨率太高而無法放入imageView。 imageView的大小是92 x 91(所以它很小)。它包含一個UIImage,它的分辨率太高,所以在UIImageView中看起來很醜。 那麼我該如何降低UIImage的分辨率呢?降低分辨率UIImage/UIImageView
我的UIImageView的代碼:
UIImageView *myImageView = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:pngFilePath]];
myImageView.frame = CGRectMake(212.0, 27, 92,91);
您對分辨率的定義是什麼?它通常用作每個單元的像素數。這聽起來像你把它定義爲圖像的尺寸。 –