本地化 MPMoviePlayerViewController 的“完成”按钮
我正在使用 MPMoviePlayerViewController 来呈现视频。一切都按预期工作,但如果我将设备的语言切换为德语,则“完成”按钮未本地化。
我尝试访问该按钮并将其设置为我自己的按钮实现,如下所示:
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
NSLog(@"%@", mp.navigationItem.leftBarButtonItem); // always null, but why?
// override button with locale
mp.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Zurück"
style:UIBarButtonItemStyleDone
target:self
action:@selector(dismissMoviePlayer:)];
[self presentMoviePlayerViewControllerAnimated:mp];
以前曾提出过类似的问题,但从未收到任何答案:objective-c MPMoviePlayerViewController 完成按钮语言。
感谢您的帮助。
I am using a MPMoviePlayerViewController to present videos. Everything works as expected, but if I switch the device's language to e.g. German, the "Done" button is not localized.
I tried to access the button and set it to my own button implementation like so:
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
NSLog(@"%@", mp.navigationItem.leftBarButtonItem); // always null, but why?
// override button with locale
mp.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Zurück"
style:UIBarButtonItemStyleDone
target:self
action:@selector(dismissMoviePlayer:)];
[self presentMoviePlayerViewControllerAnimated:mp];
A similar question has been asked before, but never received any answers: objective-c MPMoviePlayerViewController done button language.
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查 Info.plist 中的
CFBundleDevelopmentRegion
check the
CFBundleDevelopmentRegion
in your Info.plist您可以更改 xml 中的 Info.plist(作为源代码打开)并放置您的翻译。例如:
将其放入西班牙语(西班牙语不会出现在列表中)
You can change the Info.plist in xml (Open as source code) and put your translation. For example:
To put it in spanish (Spanish doesn't appear in the list)