iOS Core Animation: CALayer bringSublayerToFront?

 

 

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

上一篇:Android下拉刷新的实现---pulltorefresh


下一篇:移动端Web开发笔记