首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何更改“相机和图片库权限”说明?

如何更改“相机和图片库权限”说明?
EN

Stack Overflow用户
提问于 2019-05-04 20:45:05
回答 1查看 998关注 0票数 0

我已经在NSCameraUsageDescription和NSPhotoLibraryUsageDescription字段中指定了info.plist文件中所需的文本,但没有任何更改。

总是相同的系统文本“此应用程序需要访问相机”和“此应用程序需要访问图片库”。我已经尝试在代码中找到它了。没有找到。我在文件info.plist中指定的,在我使用的所有库中添加我的NSCameraUsageDescription和NSPhotoLibraryUsageDescription密钥。尽管如此,一切都没有改变。

info.plist文件

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>Mona</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>NSCameraUsageDescription</key>
    <string>The program wants to access the camera so you can use your photos and camera in this photo editor.</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>The program wants to access the photo gallery so you can use your photos and camera in this photo editor.</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
</dict>
</plist>

警报图像

请帮帮我。告诉我如何更改这些查询的描述。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-09 21:17:17

该字符串存在于您正在使用的Gallery库的示例项目中。

代码语言:javascript
复制
   grep -r requires .

返回:

代码语言:javascript
复制
./Gallery-2.2.0/Example/GalleryDemo/GalleryDemo/Info.plist:     <string>This app requires access to camera</string>
./Gallery-2.2.0/Example/GalleryDemo/GalleryDemo/Info.plist:     <string>This app requires access to photo library</string>

这可能有几个原因:

  1. 错误的plist

您使用的不是您发布的.plist,而是上面的use

  1. Xcode缓存

您使用的包id与运行Gallery示例代码时使用的包id相同。要确保不使用缓存,请执行以下操作:

  • 关闭Xcode
  • 从设备中删除应用程序/ simulator
  • clean派生的data
  • 打开Xcode,构建并运行
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55982650

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档