zsisme
ios核心动画高级技巧

Updated 3 years ago

liona liona (@lionaliona) started discussion #16

4 years ago · 1 comment

Open

    -drawRect: 方法没有默认的实现,因为对UIView来说,寄宿图并不是必须的,它不在意那到底是单调的颜色还是有一个图片的实例。如果UIView检测到-drawRect: 方法被调用了,它就会为视图分配一个寄宿图,这个寄宿图的像素尺寸等于视图大小乘以 contentsScale的值。

Custom Drawing (Edit this file)

-drawRect:方法创建的就是CALayer的寄宿图

No description provided.
Blunt Sword @juxingzhutou commented 3 years ago

这里应该是“如果UIView检测到-drawRect:方法存在”


to join this conversation on GitBook. Already have an account? Sign in to comment
Notifications

You’re not receiving notifications from this thread.


2 participants