C# ImageCropper.Forms在初始化时失败
我正在尝试使用ImageCropper.Forms,我已经完成了所有步骤,但初始化失败并引发此异常: 未找到方法:System.Threading.Tasks.Task`1 Plugin.Media.Abstracts.IMedia.TakePhotoAsync(Plugin.Media.Abstracts.StoreCameramedOptions) 正如您在下面看到的,我正在执行Official page推荐的所有步骤: 雄激素单C# ImageCropper.Forms在初始化时失败,c#,xamarin,xamarin.forms,C#,Xamarin,Xamarin.forms,我正在尝试使用ImageCropper.Forms,我已经完成了所有步骤,但初始化失败并引发此异常: 未找到方法:System.Threading.Tasks.Task`1 Plugin.Media.Abstracts.IMedia.TakePhotoAsync(Plugin.Media.Abstracts.StoreCameramedOptions) 正如您在下面看到的,我正在执行Official page推荐的所有步骤: 雄激素单 <application android:label=
<application android:label="MyApp" android:icon="@drawable/favicon96_96">
<!-- Image cropper activity -->
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity" android:theme="@style/Base.Theme.AppCompat" />
...
种植业
public CropperPage()
{
InitializeComponent();
Init();
}
async void Init()
{
new ImageCropper()
{
PageTitle = "Cut an image",
AspectRatioX = 1,
AspectRatioY = 1,
CropShape = ImageCropper.CropShapeType.Rectangle,
SelectSourceTitle = "Select a file",
TakePhotoTitle = "Take a picture",
PhotoLibraryTitle = "Pic gallery",
Success = (imageFile) =>
{
Device.BeginInvokeOnMainThread(() =>
{
imageView.Source = ImageSource.FromFile(imageFile);
});
}
}.Show(this);
}
我做错了什么?我只需要从Nuget安装ImageCropper.Forms.Fix包,一切都按预期开始工作。嗨,记得在有时间时标记答案,这将帮助其他有类似问题的人。:-)
public CropperPage()
{
InitializeComponent();
Init();
}
async void Init()
{
new ImageCropper()
{
PageTitle = "Cut an image",
AspectRatioX = 1,
AspectRatioY = 1,
CropShape = ImageCropper.CropShapeType.Rectangle,
SelectSourceTitle = "Select a file",
TakePhotoTitle = "Take a picture",
PhotoLibraryTitle = "Pic gallery",
Success = (imageFile) =>
{
Device.BeginInvokeOnMainThread(() =>
{
imageView.Source = ImageSource.FromFile(imageFile);
});
}
}.Show(this);
}