2012-02-20 82 views

回答

0

MPMoviePlayerViewController就像任何其他視圖控制器。您應該能夠設置您自己的自定義視圖,然後將按鈕連接到MPMoviePlayerViewController中包含的moviePlayer

0

您是否想爲下面的代碼創建MPMovieViewController的自定義,用於創建自定義的Moviecontroller。 。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    self.window.backgroundColor = [UIColor whiteColor]; 

    MainScreenVCtr *tempVariable=[[MainScreenVCtr alloc] initWithNibName:(UI_USER_INTERFACE_IDIOM())[email protected]"MainScreeniPad":@"MainScreenVCtr" bundle:nil]; 

    self.nvCtr=[[UINavigationController alloc] initWithRootViewController:tempVariable]; 

    self.nvCtr.view.frame=CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height-20); 

    [[NSNotificationCenter defaultCenter] addObserver:self 
              selector:@selector(moviePlayBackDidFinish:) 
               name:MPMoviePlayerPlaybackDidFinishNotification 
               object:nil]; 

    [self.window addSubview:self.nvCtr.view]; 

    self.vCtr=[[CustomControllsVCtr alloc] initWithNibName:(UI_USER_INTERFACE_IDIOM())[email protected]"CustomControllsiPad":@"CustomControllsVCtr" bundle:nil]; 

    [self.window makeKeyAndVisible]; 
    return YES; 
} 

And refer the reference link and Download the source code and implementation tutorail given here.

希望本教程幫助您創建自定義MPViewcontroller。

快樂編碼

相關問題