码迷,mamicode.com
首页 > 移动开发 > 详细

iOS Core Animation: CALayer bringSublayerToFront?

时间:2014-05-08 14:01:24      阅读:386      评论:0      收藏:0      [点我收藏+]

标签:des   class   code   int   strong   c   

 

 

-(void) bringSublayerToFront:(CALayer*)layer
{[layer removeFromSuperlayer];[self insertSublayer:layer atIndex:[self.sublayers count]-1];}-(void) sendSublayerToBack:(CALayer*)layer
{[layer removeFromSuperlayer];[self insertSublayer:layer atIndex:0];}

Note: if you don‘t use ARC, you may wish to add [layer retain] at top and [layer release] at bottom of both functions to make sure layer is not accidentally destructed in a case it has retain count = 1.

iOS Core Animation: CALayer bringSublayerToFront?,布布扣,bubuko.com

iOS Core Animation: CALayer bringSublayerToFront?

标签:des   class   code   int   strong   c   

原文地址:http://www.cnblogs.com/spiderdzl/p/3713992.html

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