[英]C# Xamarin forms how to access device gallery and retrieve all images for a custom gallery grid view
On my Xamarin app I'm currently working to create an image selection view. 目前,我正在Xamarin应用程序上创建图像选择视图。 For this view I'm attempting to retreive images from the Android/iOS device and display them on the page in a selection grid. 对于此视图,我试图从Android / iOS设备检索图像并将其显示在选择网格中的页面上。
What I would like is to do is access the default device gallery to retreive references to the individual files and pass these into an array. 我想做的是访问默认设备库以检索对单个文件的引用,并将它们传递到数组中。
So far I have been using the Xamarin CrossMedia plugin to pick photos, but after reading throgh the docs I'm not seing the desired functionality provided. 到目前为止,我一直在使用Xamarin CrossMedia插件来拾取照片,但是在阅读了文档之后,我并没有掌握提供的所需功能。 I've also tried retreiving the device paths for images, but found no good way to get any further than this. 我也尝试过检索图像的设备路径,但没有找到进一步的好方法。
Eg the expected/desired result is that I can access device storage to obtain references to the images on the phone, references that I then can use to fill the custom grid cells. 例如,预期/期望结果是我可以访问设备存储以获取对电话上图像的引用,然后这些引用可以用于填充自定义网格单元。
PhotoKit framework for iOS solves this. 适用于iOS的PhotoKit框架解决了这一问题。 Closing the question, Android is still unsolved. 最后,Android仍未解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.