I am trying to insert sub layer behind the CAEagllayer. However it is always appear front of the eagllayer.
CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
// Use 2x scale factor on Retina displays.
self.contentScaleFactor = [[UIScreen mainScreen] scale];
eaglLayer.opaque = TRUE;
eaglLayer.drawableProperties = @{ kEAGLDrawablePropertyRetainedBacking :[NSNumber numberWithBool:NO],
kEAGLDrawablePropertyColorFormat : kEAGLColorFormatRGBA8};
CALayer *sublayer = [CALayer layer];
sublayer.backgroundColor = [UIColor blueColor].CGColor;
sublayer.shadowOffset = CGSizeMake(0, 3);
sublayer.shadowRadius = 5.0;
sublayer.shadowColor = [UIColor blackColor].CGColor;
sublayer.shadowOpacity = 0.8;
sublayer.frame = CGRectMake(30, 30, 128, 192);
[self.layer insertSublayer:sublayer below:eaglLayer];
sublayer.zPosition = -1000;
0 comments:
Post a Comment