1
我想添加一個自定義播放按鈕,但不能把它放在視頻前面。這是我的代碼。如何創建一個按鈕作爲MPMoviePlayerController的子視圖?
- (IBAction)playMovie:(UIButton *)sender {
NSURL *url = [[NSURL alloc] initWithString:urlStr.text];
self.movie = [[MPMoviePlayerController alloc]initWithContentURL:url];
self.movie.controlStyle = MPMovieControlStyleNone;
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height)];
button.backgroundColor=[UIColor yellowColor];
[button setTitle:@"Normal State Title" forState:UIControlStateNormal];
[movie.view addSubview:button];
self.movie.shouldAutoplay = YES;
[self.view addSubview:self.movie.view];
[self.movie setFullscreen:YES animated:NO];
}
你能指導我如何創建自定義進度條嗎? –