开发者

How to apply shadow to a video in an iOS app

开发者 https://www.devze.com 2023-04-03 09:42 出处:网络
I tried to apply a shadow to a video in this way: moviePlayer.view.frame = CGRectMake(83, 123, 629, 424);

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

精彩评论

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