roubachof/Sharpnado.CollectionView

Image inside HorizontalListView is disappearing on drag and drop in IOS

Closed this issue · 10 comments

  • OS: [iOS]
  • Device: IPAD
  • Sdk vervion: [iOS 14.5]
  • Xamarin.Forms: [5.0.0.2012]

Image inside HorizontalListView is disappearing on drag and drop on IOS

To Reproduce
Steps to reproduce the behavior:

  1. Add images in HorizontalListView
  2. drag and drop an item
  3. Image will disappear

Please add images from gallery
Sorry about that

Can you please guide me to a workaround may be, I am stuck

I don't understand what is your problem.
Just have a look at the sample.

I have looked at it. But my issue is that I am adding images in HorizontalListView from gallery and when I drag an image from one index to another image disappears. I have attached the video.
Thanks in advance for your help

2021-05-17_22-05-40.mp4

Were you able to reproduce this issue ?

nope, but it's not a list view issue though, it's more where you are storing your image when to pick it...

horizontalDragandDropTest.zip

I have created a sample project and attached it with this comment, you can see in this project what I am talking about.

Image loading: Image load failed: System.ArgumentNullException: Value cannot be null.
Parameter name: data
at ObjCRuntime.ThrowHelper.ThrowArgumentNullException (System.String argumentName) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/ThrowHelper.cs:28
at ObjCRuntime.NativeObjectExtensions.GetNonNullHandle (ObjCRuntime.INativeObject self, System.String argumentName) [0x00003] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/INativeObject.cs:27
at UIKit.UIImage.LoadFromData (Foundation.NSData data, System.nfloat scale) [0x00006] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/UIKit/UIImage.g.cs:956
at Xamarin.Forms.Platform.iOS.StreamImagesourceHandler.LoadImageAsync (Xamarin.Forms.ImageSource imagesource, System.Threading.CancellationToken cancelationToken, System.Single scale) [0x000ad] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ImageRenderer.cs:182
at Xamarin.Forms.Platform.iOS.ImageElementManager.GetNativeImageAsync (Xamarin.Forms.ImageSource source, System.Threading.CancellationToken cancellationToken) [0x00074] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ImageElementManager.cs:281

It gives me this exception on dropping the element

as you can see this has nothing to do with the horizontal list view.
it's just that you are not handling correctly your images picked from ios gallery.
data is null => the image data is null.
I guess you need to copy them in your application directory or something...