开发者

How to draw using drawRect on top of playing video - Apple IOS, Obj-C

I want to be able to draw custom shapes and so forth o开发者_如何学Pythonn top of a playing movie file. At the moment I have a UIView subclass that I have overwritten the drawRect method in and I do my drawing in here, this works as expected.

I added a MPMovieplayerViewController to my viewController and can play a video on it ok except that I'm guessing that its in a new window on top of my subclassed UIView.

I have tried adding a new UIView as a subview to the movie view.

UIView *newSubView = [[UIView alloc] initWithFrame: CGRectMake ( 0, 0, 100, 100)];
newSubView.backgroundColor = [UIColor redColor];
[theMovie.view addSubview:newSubView];

And I can see this works because I can see the red View on top of my video, but how can I add a subview with a drawRect method that I can draw in?

I have spent way too long on this and now hope a noble coder is able to point me the right direction.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜