首页 > 移动平台 > 详细

iOS Core Animation: CALayer bringSublayerToFront?

时间:2014-05-08 14:00:43      阅读:613      评论:0      收藏:0      [点我收藏+]

 

 

-(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?

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!