I have try many think but no success yet, My question is that I Have one video on that I was provide a functionality to write text over the video and drag/drop that text over the video now I wand to set CATextlayer on video with propper position which was set by user but its not display on proper position so please help me.
This is my code which was I used for this.
CATextLayer *titleLayer = [CATextLayer layer];//<========code to set the text
titleLayer.string = self.strText;
titleLayer.font = (__bridge CFTypeRef)(self.fonts);;
titleLayer.fontSize = titleLayer.fontSize;
titleLayer.position = CGPointMake (titleLayer.fontSize,titleLayer.fontSize);
//?? titleLayer.shadowOpacity = 0.5;
titleLayer.alignmentMode = kCAAlignmentCenter;
titleLayer.bounds = CGRectMake(self.rectText.origin.x,self.rectText.origin.y-52, 480, 480); //You may need to adjust this for proper display
[titleLayer setBackgroundColor:[UIColor redColor].CGColor];
[parentLayer addSublayer:titleLayer]; //ONLY IF WE ADDED TEXT
Your code seems fine, but not sure if the frame provided is wrong or right. If you have provided the right frame then add this code, in the end:-
It will work now!
Solved the issue see my below code. This was working fine with video
Solved the issue see my below code. This was working fine with video.