Tencent / LKImageKit

A high-performance image framework, including a series of capabilities such as image views, image downloader, memory caches, disk caches, image decoders and image processors.
Other
2.08k stars 287 forks source link

为什么LKImageview继承UIView而不是继承UIImageview #7

Closed helinyu closed 6 years ago

helinyu commented 6 years ago

image

helinyu commented 6 years ago

这样冗余一个View会不会影响性能?

kelingjie1 commented 6 years ago

结论是几乎不会影响。 至于为什么需要嵌套一个,这是由于要支持各种各样的缩放和裁剪模式。相对于功能性的提升,这里很小的额外性能开销是可以放弃的。 而且对于滑动流畅性来说,这里的开销只是一个零头。