I have implemented Drag and Drop on SwiftUI using onDrag
and onDrop
APIs. I have a question regarding the preview image for the drag. The item seems to shrink too much when we start dragging. As you can see in the gif below, the width of the item is equal to the whole screen's width. On drag, the preview shrinks a lot. Is there anyway I can retain the same size?
onDrag: preview {}
closure doesn't help either in this case. Is this like a built in effect or am I doing something wrong with the view. The view which is being dragged doesn't have any frames - its all dynamic (Hstacks
, spacers
etc).