Xamarin.forms 如何使用crossmedia拍摄多张照片

Xamarin.forms 如何使用crossmedia拍摄多张照片,xamarin.forms,xamarin.android,xamarin.ios,Xamarin.forms,Xamarin.android,Xamarin.ios,如何使用Crossmedia拍摄多张照片,我使用它它工作得很好,但它会一次又一次地导航,但我不想要这个 bool isCamera = true; while (isCamera) { file = await MediaPicker.TakePhotoAsync(new StoreCameraMediaOptions { SaveToAlbum = true, Name = "", Directory = "" }); if (file != null)

如何使用Crossmedia拍摄多张照片,我使用它它工作得很好,但它会一次又一次地导航,但我不想要这个

bool isCamera = true;
while (isCamera)
{
file = await MediaPicker.TakePhotoAsync(new StoreCameraMediaOptions { SaveToAlbum = true, Name = "", Directory = "" });
if (file != null)
{
//save code}
else{
isCamera=false;
}

该插件不支持多选。所以我们需要为每个平台使用依赖服务来实现它

自己从多媒体资料中选择媒体。看看这个

对于Android

public void OpenGallery()
{
    try
    {
        var imageIntent = new Intent(Intent.ActionPick);
        imageIntent.SetType("image/*");
        imageIntent.PutExtra(Intent.ExtraAllowMultiple, true);
        imageIntent.SetAction(Intent.ActionGetContent);
        ((Activity)Forms.Context).StartActivityForResult(Intent.CreateChooser(imageIntent, "Select photo"), OPENGALLERYCODE);
        Toast.MakeText(Xamarin.Forms.Forms.Context, "Tap and hold to select multiple photos.", ToastLength.Short).Show();
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.ToString());
        Toast.MakeText(Xamarin.Forms.Forms.Context, "Error. Can not continue, try again.", ToastLength.Long).Show();
    }
}

对于iOS,您可以使用插件

我希望获得帮助,因为他们可以拍摄(拍摄功能而不是拾取)多张图像,然后单击使用xamarin表单保存。除了crossmedia之外,还有其他任何这样做的方法……你为什么不自己实现呢?