MPMoviePlayerViewController与外观框架(iOS 5)
我在我的项目中使用MPMoviePlayerViewController。所以,现在MPMoviePlayerViewController也使用导航栏MPMoviePlayerViewController与外观框架(iOS 5)
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil]
setBackgroundImage:[UIImage imageNamed:@"woodenBarButton"]
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navigationbarBackground"]
forBarMetrics:UIBarMetricsDefault];
:我已经定义了如下外观UIButtons和UINavigationBar的,像这样。现在的问题是:按钮使用给定的外观,但工具栏不= =>它看起来很糟糕。所以现在我有以下问题:
- 我可以说服MPMoviePlayerViewController中的UINavigationBar使用外观?
- 或者can只能为MPMoviePlayerViewController完全移除外观。
我试图通过playerViewController.navigationitem.leftbarbuttonitem访问按钮并覆盖属性,但这是行不通的。
如果你能帮助我,那会很棒。谢谢。
您是否还尝试过为MPMoviePlayerViewController
设置appearanceWhenContainedIn
? appearance
和appearanceWhenContainedIn
同时工作。
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navigationbarBackground"]
forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearanceWhenContainedIn:[MPMoviePlayerViewController class], nil] setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
工作!完善。 – Saibot
很高兴能有所帮助。请将此答案标记为正确答案(复选标记),因为它是在stackoverflow上的常见行为。 thx – Buju
使用此技术还可以在展示MFMessageComposeViewController时去除外观自定义。谢谢 – jumponadoughnut
没人能帮我吗? – Saibot