iOS 7 MPMoviePlayerController更改完成button的名称

在iOS 6中,我们在MPMoviePlayerController中更改donebutton的名称:

id mpBarAppearance = [UIBarButtonItem appearanceWhenContainedIn:[MPMoviePlayerViewController class], nil]; [mpBarAppearance setTitle:@"ГОТОВО"]; [mpBarAppearance setTitlePositionAdjustment:UIOffsetMake(1.5f, 1.f) forBarMetrics:UIBarMetricsDefault]; [mpBarAppearance setTitlePositionAdjustment:UIOffsetMake(1.5f, 1.f) forBarMetrics:UIBarMetricsLandscapePhone]; 

现在在iOS 7这个崩溃的应用程序,在debbug下没有发生exception,我甚至不明白为什么?

这是因为你不能使用外观代理来定制UIBarButtonItem的标题。 否则,给定父项中包含的所有栏button将被命名为相同。 您可以自定义其他外观参数,如背景图像,标题位置等。

UIBarButtonItem的外观代理引用可以在这里find