c# - 在 Xamarin Forms iOS 应用程序中访问共享存储位置

标签 c# ios xamarin xamarin.ios xamarin.forms

是否可以在Xamarin Forms应用程序中访问使用应用程序组的存储位置?我已经看到了从 Xamarin iOS 应用程序访问相同内容的引用。引用:https://developer.xamarin.com/guides/ios/watch/working-with/app-groups/

无法在表单应用中找到该选项。在 Xamarain Forms 应用程序属性窗口中看不到启用应用程序组的规定。

对此有任何帮助。

最佳答案

使用 App Groups 是特定于 iOS 的平台,因此在代码方面您需要使用依赖服务:

https://developer.xamarin.com/guides/xamarin-forms/dependency-service/

要启用应用程序组,您需要在 iOS 项目 中打开 Entitlements.plist 文件,而不是共享/PCL 项目 - 同样,这是因为它是一个平台特定功能。

关于c# - 在 Xamarin Forms iOS 应用程序中访问共享存储位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35769495/

相关文章:

Xamarin Forms CollectionView TapGestureRecognizer 未在标签上触发

c# - 访问具有特定值的 XElement

c# - 使用 C# 和 MonoTouch 制作 iOS 库或框架

c# - 这种继承特性的用例是什么?

iOS - 用户界面在触摸后移动

ios - 带有 MVVM Light 的选项卡栏 Controller 导航 Xamarin

c# - 编辑文件元数据 - 代码在 VB 中可以,但在 C# 中不行

ios - 从内存中释放图像, swift

ios - ASIHTTPRequest 响应数据 null

android - 重复使用 Xamarin.Essentials.MediaPicker.CapturePhotoAsync 会在 Android 11 上重新启动我的应用程序