裁剪方法--layer.makesToBounds 和 clipsToBounds区别和联系

layer.makesToBounds 和 clipsToBounds

  • 他们是不同的名字,因为UIView和CALayer是不同的,有不同的术语与他们有联系的,但它们在功能上是等价的。如果你拆开clipsToBounds你会看到它只是调用masksToBounds
    self.imageListView.layer.cornerRadius = 5;
    self.imageListView.clipsToBounds = YES;
//    self.imageListView.layer.masksToBounds = YES;
-(BOOL)[UIView(Rendering) clipsToBounds]
    +0  3091938a  55                      pushl       %ebp
    +1  3091938b  89e5                    movl        %esp,%ebp
    +3  3091938d  e800000000              calll       0x30919392
    +8  30919392  59                      popl        %ecx
    +9  30919393  8b4508                  movl        0x08(%ebp),%eax
   +12  30919396  8b5004                  movl        0x04(%eax),%edx               (CALayer)_layer
   +15  30919399  8b8186cb1301            movl        0x0113cb86(%ecx),%eax         masksToBounds
   +21  3091939f  89450c                  movl        %eax,0x0c(%ebp)
   +24  309193a2  895508                  movl        %edx,0x08(%ebp)
   +27  309193a5  c9                      leave
   +28  309193a6  e92e211801              jmpl        0x31a9b4d9
posted @ 2015-09-13 01:20  紫之灵玲  阅读(1607)  评论(0编辑  收藏  举报