回答
我發現的唯一方法是在查找前進按鈕上添加一個透明按鈕。 這裏是代碼:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
UIButton *button = [[UIButton alloc] init];
if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
[button setFrame:CGRectMake(535, 599, 90, 60)];
else
[button setFrame:CGRectMake(407, 855, 90, 60)];
[button setBackgroundColor:[UIColor clearColor]];
[button setAlpha:0.7];
[button setTag:1200];
[self.moviePlayer.view addSubview:button];
[button release];
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if(UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
{
UIButton *button = (UIButton *)[self.moviePlayer.view viewWithTag:1200];
[button setFrame:CGRectMake(535, 599, 90, 60)];
}
else
{
UIButton *button = (UIButton *)[self.moviePlayer.view viewWithTag:1200];
[button setFrame:CGRectMake(407, 855, 90, 60)];
}
}
這是隻適用於IPAD!如果您想在iPhone上做同樣的事情,請更改透明按鈕的位置。
而當Apple更新控制器的位置時,那又怎樣? –
然後,如果你不喜歡這個答案,請找到另一種方式來做到這一點。 :P ...哦,並且是Apple接受的一種方式。謝謝 –
你總是可以提供一個自定義的控制面板,你可以隱藏默認控件與
playerController.controlStyle = MPMovieControlStyleNone;
然後添加包含您的接口子視圖,只是鏈接按鈕播放/暫停開始/停止倒帶,並且有一個變速滑塊的開源實現(OBSlider)。您還需要註冊一些MP通知:
MPMovieDurationAvailableNotification
MPMoviePlayerLoadStateDidChangeNotification
MPMoviePlayerPlaybackDidFinishNotification
MPMoviePlayerPlaybackStateDidChangeNotification
我只需要禁用seek forward按鈕。 –
- 1. asp禁用按鈕回發
- 2. 禁用發送按鈕
- 3. 禁用發送按鈕
- 4. 發佈禁用按鈕不在Mozilla中查看禁用
- 5. Devexpress按鈕在第一次回發後發生禁用按鈕
- 6. 禁用按鈕
- 7. 禁用按鈕
- 8. 禁用按鈕
- 9. 禁用按鈕
- 10. 禁用提交按鈕,直到用戶名查找有效
- 11. 禁用後禁用按鈕
- 12. 觸發器禁用並啓用按鈕
- 13. Visual Studio 2010 - 試圖在文件中查找時禁用「查找全部」按鈕
- 14. 如何查找是否在Selenium IDE中禁用按鈕
- 15. MFmailcomposer的發送按鈕未被禁用...?
- 16. 禁用提交按鈕JavaScript時觸發
- 17. 禁用按鈕回發在JSF2.0
- 18. 禁用回發按鈕ASP.NET C#
- 19. MFMailcomposeviewcontroller發送按鈕被禁用
- 20. 爲空輸入禁用發送按鈕
- 21. 禁用表單提交按鈕,但發佈按鈕值
- 22. 檢查,如果按鈕被禁用
- 23. GitX - 已禁用查看按鈕
- 24. 禁用警報查看按鈕
- 25. 禁用與單選按鈕檢查EditText
- 26. 禁用cPanel查找用戶轉發電子郵件
- 27. Ext.form.field.File禁用按鈕
- 28. MotionCaptcha禁用按鈕
- 29. Android禁用按鈕
- 30. UIToolBar - 禁用按鈕
提供了一些代碼或更多的信息你實際上在做什麼... – DShah
我提出了一個MPMediaPlayerViewController來播放電影。必須防止用戶快進電影。但是落後和播放/暫停功能必須工作。 –