SwiftUI Drag and Drop preview shrinks too much on drag
Asked Answered
P

0

7

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).

enter image description here

Peroration answered 17/4, 2023 at 14:41 Comment(2)
I'm facing this problem now, did you find out solution ? is using onMove an option to you? with onMove, it doesn't shrink unless you drag it to the navigation areaSaccharoid
Have toga same shrinking problem, onMove has a different set of problems that is more serious for me than shrinking.Meir

© 2022 - 2024 — McMap. All rights reserved.