How to set texture to CALayer in ios? -
How to apply for calayer with the level of ambiguity like a combination of image texture and calayer image like texture (below) can go? You can use this Edit Try adding this sub-layer to the current layer. It will give you ideas for how to do this. You can also try setting the mask < Code> UIImage * yourImage = [UIImage imageNamed: @ "Your Profile Image"]; Self.ourView.layer.contents = (__Bridge ID) yourImage.CGImage;
This will draw some circle int radius = 30.0; UIBezierPath * Path = [UIBezierPath bezierPathWithRoundedRect: CGRectMake (0, 0, 20.0, 20.0) Radius: Radius: 0]; UIBezierPath * circlePath = [UIBezierPath bezierPathWithRoundedRect: CGRectMake (0, 0; 2.0 * radius, 2.0 * radius) cornerRadius: radius]; [Route apendapath: circlepath]; [Route set USFFFRRUURU: yes]; Casplayer * filler = [capsular layer]; FillLayer.path = Path. CGPath; FillLayer.fillRule = KCFlyRuleWed; FillLayer.fillColor = [UIColor blackColor] .CGColor; FillLayer.opacity = 0.7; [Self.view.layer addSublayer: filllayer];
[self.view.layer setMask: filllayer];
Comments
Post a Comment