iOS 7 MPMoviePlayerController更改完成按钮的名称 [英] iOS 7 MPMoviePlayerController change name of Done button

查看:97
本文介绍了iOS 7 MPMoviePlayerController更改完成按钮的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 6中,我们在下一个方式更改MPMoviePlayerController中的完成按钮名称:

In iOS 6 we change name of done button in MPMoviePlayerController next way:

    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下它没有引发异常,我甚至无法理解为什么?

Now in iOS 7 this crash app, under debbug it no raise exception and I cann't even understand why ?

推荐答案

这是因为您无法使用外观代理来自定义 UIBarButtonItem的标题秒。否则,给定父级中包含的所有条形按钮的名称都相同。您可以自定义其他外观参数,例如背景图像,标题位置等。

It's because you can't use the appearance proxy to customise the title of UIBarButtonItems. Otherwise, all the bar buttons contained in the given parent would be named the same. You can customise other appearance parameters such as the background images, title position and so on.

UIBarButtonItem的外观代理参考可以找到这里

这篇关于iOS 7 MPMoviePlayerController更改完成按钮的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆