2009-11-02 56 views
0

我想放一部電影在我的應用程序開始,但我想隱藏像電影裏的控件(停止,播放,下一個和...)這裏是我的代碼:我如何隱藏MPMoviePlayer控件?

#import <MediaPlayer/MediaPlayer.h> 



-(void)viewDidLoad 
{ 
    NSBundle *bundle = [NSBundle mainBundle]; 
    NSString *moviePath = [bundle pathForResource:@"myvideo" ofType:@"mp4"]; 
    NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain]; 
    MPMoviePlayerController *IntroMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; 
    [IntroMovie play]; 
} 

回答

2

好吧,我理解了它。

代碼:

IntroMovie.movieControlMode = MPMovieControlModeHidden; 
3

你可以做IntroMovie.controlStyle = MPMovieControlStyleNone;

由於.movi​​eControlMode已被否決。

0

在Objective-C

moviePlayer.controlStyle = MPMovieControlStyleNone; 

在夫特

moviePlayer.controlStyle = MPMovieControlStyle.None