本文介绍了iOS 10相机视图显示API_Cancel_Title而不是“取消”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iOS 10和使用相机拍照的应用程序。打开相机视图时,标题为 API_CANCEL_TITLE,而不是取消按钮。当我捕获图片时,整个标题都可以看到,我希望它看起来不是长,而不是这个长标题。我已经使用了应用本地化。我搜索了几个链接,但找不到解决方案。

I am working on an app using iOS 10 and using camera for taking pictures. When camera view opens, instead of cancel button there is a title "API_CANCEL_TITLE". And when I capture the pic the whole title is seeing, I want that instead of this long title it will be look "Cancel". I have used app localization. I searched few links but could not find the solution.

以下是屏幕截图:

这仅在iOS 10中发生,在iOS 9中将正确运行
代码是:

This is happening only in iOS 10, in iOS 9 it will working correctlyhere is the code:

- (IBAction)takePicturePressed:(UIButton *)sender
{

    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.allowsEditing = YES;
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    [self presentViewController:picker animated:YES completion:nil];
}

请建议...

推荐答案

我已经使用处理了相同的问题
,我已经跟踪了 UIImagePickerController 键,它是从捆绑中获取的。

I've approached the same problem using BundleLocalizationand I've traced UIImagePickerController keys, that it gets from a bundle.

结果是,它使用4个表(在NSBundle命名法中):

Turns out, it uses 4 "tables" (in NSBundle nomenclature):


  • CameraUI (用于相机)

  • PhotoLibraryServices (用于PhotoLibrary)

  • PhotoLibrary (用于PhotoLibrary)

  • PhotosUI (用于PhotoLibrary)

  • CameraUI (for camera)
  • PhotoLibraryServices (for PhotoLibrary)
  • PhotoLibrary (for PhotoLibrary)
  • PhotosUI (for PhotoLibrary)

就我而言,我要做的就是本地化 UIImagePickerController 接口,它是在项目中创建的几个 .strings 文件并对其进行本地化。

In my case, all I had to do, to localize UIImagePickerController interface, it was create in the project a couple of .strings files and localize them.

下面提到的文件内容均带有我见过的键(标准英文值) ),他们很能自我解释

Below content of mentioned files with keys I've seen (with standard english values), they are pretty self explaining

"PHOTO" = "PHOTO";
"AEAF_LOCK_TEXT" = "AE/AF LOCK";
"API_CANCEL_TITLE" = "Cancel";
"HDR_AUTO" = "Auto";
"HDR_ON" = "On";
"HDR_OFF" = "Off";
"TIMER_OFF_TEXT" = "Off";
"USE_PHOTO" = "Use Photo";



PhotoLibraryServices.strings

PhotoLibraryServices.strings

"PHOTOS" = "Photos";
"CAMERA_ROLL" = "Camera roll";
"ALL_SCREENSHOTS" = "Screenshots";



PhotoLibrary.strings

PhotoLibrary.strings

"CANCEL" = "Cancel";
"RETAKE" = "Retake";
"STREAM_SHARED_BY_ME_SUBTITLE" = "From You";
"STREAM_SHARED_BY_SUBTITLE" = "From %@";
"ALBUM_IMAGE_COUNT_FORMAT" = "%@ Photos";
"ALBUM_VIDEO_COUNT_FORMAT" = "%@ Videos";
"1_ALBUM_PHOTO" = "1 Photo";
"1_ALBUM_VIDEO" = "1 Video";
"ALBUM_TWO_TYPES_LABEL_COMMAS" = "%@, %@";



PhotosUI.strings

PhotosUI.strings

"ALL_PHOTOS_IN_LIBRARY" = "Moments";
"PXUserCollectionsSectionTitle" = "My Albums";
"FULL_PHOTOS_GRID_ZOOM_LEVEL_TITLE" = "Moments";
"NO_PHOTOS_OR_VIDEOS" = "No Photos or Videos";
"EMPTY_ALBUM_LIST_MESSAGE_iPhone" = "You can take photos and videos using camera, or sync photos and videos onto your iPhone using iTunes";

这篇关于iOS 10相机视图显示API_Cancel_Title而不是“取消”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 05:32