首先新创建个文件 命名为 InfoPlist.string
1.New File -> Resource -> String File 创建 命名为 InfoPlist.string
2.InfoPlist.string 在右边找到 Localize 点击,如果要是直接生成英文,需要到 project-> info-> Localizations 手动添加下你需要其他的语言,默认勾选要添加对应语言的文件,如果点击Localize 让你选择对应的语言,就不需要去 project-> info-> Localizations添加了
4.InfoPlist.string 设置好之后,有对应的文件 比如 InfoPlist.string (English) 就可以进行对应的app名称、权限提示语言进行适配了
下面提供下对应的key
"CFBundleDisplayName" = "App名称";
"NSMediaLibraryUsageDescription" = "媒体库";
"NSCameraUsageDescription" = "相机";
"NSPhotoLibraryUsageDescription" = "相册";
"NSPhotoLibraryAdditionsUsageDescription" = "相册";
"NSMicrophoneUsageDescription" = "麦克风";
"NSContactsUsageDescription" = "通讯录";
"NSLocationWhenInUseUsageDescription" = "位置";
"NSLocationAlwaysUsageDescription" = "位置";