码迷,mamicode.com
首页 > 其他好文 > 详细

clipsToBounds 与 masksToBounds 的区别与联系

时间:2016-03-27 19:33:26      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:

clipsToBounds
是指视图上的子视图,如果超出父视图的部分就截取掉,
masksToBounds
却是指视图的图层上的子图层,如果超出父图层的部分就截取掉

在调用 clipsToBounds 方法时,就会调用其 layer 的 masksToBounds 方法:

 1 -(BOOL)[UIView(Rendering) clipsToBounds]
 2     +0  3091938a  55              pushl    %ebp
 3     +1  3091938b  89e5            movl     %esp,%ebp
 4     +3  3091938d  e800000000      calll    0x30919392
 5     +8  30919392  59              popl     %ecx
 6     +9  30919393  8b4508          movl     0x08(%ebp),%eax
 7    +12  30919396  8b5004          movl     0x04(%eax),%edx         (CALayer)_layer
 8    +15  30919399  8b8186cb1301    movl     0x0113cb86(%ecx),%eax    masksToBounds
 9    +21  3091939f  89450c          movl     %eax,0x0c(%ebp)
10    +24  309193a2  895508          movl     %edx,0x08(%ebp)
11    +27  309193a5  c9              leave
12    +28  309193a6  e92e211801      jmpl     0x31a9b4d9

 

clipsToBounds 与 masksToBounds 的区别与联系

标签:

原文地址:http://www.cnblogs.com/xiayao/p/5326320.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!