I am trying to set the frame of my CALayer in this code below
CGRect VFrame; VFrame = CGRectMake(self.viewNo2.frame.origin.x, self.viewNo2.frame.origin.y, self.viewNo2.frame.size.width, self.viewNo2.frame.size.height); self.customLayer = [CALayer layer]; self.customLayer.frame = VFrame; self.customLayer.contentsGravity = kCAGravityResizeAspectFill; [self.view.layer addSublayer:self.customLayer];
For some reason, the layer goes somewhere around this frame, but not like the frame I'm trying to declare.
Does anyone know what the problem is?
source share