使用 UIView ContentMode ScaleAspectFit 填充 View 的图像的最佳或标准纵横比是多少,或者填充 View 的图像的最佳分辨率是多少???
最佳答案
据我所知,您无需担心图像的长宽比。如果将 View 的内容模式设置为UIViewContentModeScaleAspectFit,那么它
Scales the content to fit the size of the view. This option maintains the aspect ratio of the content. Any remaining area of the view’s bounds is transparent.
如果图像尺寸为 60x40,并且 View 尺寸为 200x200,则图像将以 180x120 尺寸显示,并以其 super View 为中心。如果您的图像的 super View 太大而无法容纳,则您的图像可能会丢失一些细节。
关于iphone - 使用 UIViewContentModeScaleAspectFit 填充 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6645712/