Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想这个问题可以适用于iphone和android。
当我想显示较小的图像时,
我发现选项 1 更快。 我一直想知道为什么?
我还想知道图像消耗的内存是由 imageView 或 image 的大小决定的吗?
这是个好问题,我认为当我们将 imageView 的大小调整为更小并且图像(UIImage)更大时,内存消耗更多,因为图像(UIImage)的大小更尊重 imageView 中的显示。我认为第二种选择可以节省内存。
调整图像大小需要额外的 CPU 周期。因此最好手动调整图像大小。