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.
精彩评论