开发者

How to apply shadow to a video in an iOS app

I tried to apply a shadow to a video in this way:

moviePlayer.view.frame = CGRectMake(83, 123, 629, 424);
[self.view addSubview:moviePlayer.view];

videoLayer = [CALayer layer];
videoLayer.contents = (id)moviePlayer.view;
videoLayer.frame = moviePlayer.view.frame;

videoLayer.shadowOffset = CGSizeMake(0, 3);
videoLayer.shadowRad开发者_Python百科ius = 5.0;
videoLayer.shadowColor = [UIColor blackColor].CGColor;
videoLayer.shadowOpacity = 0.8;

[self.view.layer addSublayer:videoLayer];

[moviePlayer play];

but shadow doesn't appear. What's wrong?


moviePlayer.view.frame = CGRectMake(83, 123, 629, 424);
[self.view addSubview:moviePlayer.view];

moviePlayer.view.layer.shadowOffset = CGSizeMake(0, 3);
moviePlayer.view.layer.shadowRadius = 5.0;
moviePlayer.view.layer.shadowColor = [UIColor blackColor].CGColor;
moviePlayer.view.layer.shadowOpacity = 0.8;

[moviePlayer play];

Try that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜