0
在我的應用程序中,我使用MPMoviePlayer播放視頻。 我在電影播放器上添加了一個「跳過廣告」(您可以在電影播放器的右側看到)按鈕。它在iOS5中工作正常,但是當我在iOS6中運行我的應用程序時,該按鈕在Movieplayer變成全屏。按鈕只在iOS6中隱藏
爲什麼會發生這種情況......任何想法? 幫助我克服this..thanks提前
下面是用於添加MPMovieplayer按鈕的代碼,以及屏幕截圖
UIButton *skipButton = [UIButton buttonWithType:UIButtonTypeCustom];
skipButton.frame = CGRectMake(264.0,195.0, 67.0, 25.0);
[skipButton setTitle:@"" forState:UIControlStateNormal];
skipButton.backgroundColor = [UIColor clearColor];
[skipButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal ];
UIImage *buttonImageNormal3 = [UIImage imageNamed:@"skipad.png"];
UIImage *strechableButtonImageNormal3 = [buttonImageNormal3 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
[skipButton setBackgroundImage:strechableButtonImageNormal3 forState:UIControlStateNormal];
UIImage *buttonImagePressed3 = [UIImage imageNamed:@"skipad.png"];
UIImage *strechableButtonImagePressed3 = [buttonImagePressed3 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
[skipButton setBackgroundImage:strechableButtonImagePressed3 forState:UIControlStateHighlighted];
[skipButton addTarget:self action:@selector(skipAction:) forControlEvents:UIControlEventTouchUpInside];
[[[UIApplication sharedApplication] keyWindow] addSubview:skipButton];
在iOS5中 -
在iOS6的 -
你爲什麼不添加按鈕,電影播放器的[圖](HTTP:// developer.apple.com/library/ios/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/Reference/Reference.html#//apple_ref/occ/instp/MPMoviePlayerController/view)而不是主窗口? –
你可以指定如何添加像? – user2115266
與somethig像:[self.view addSubview:skipButton];我猜:) – Lucabro