My question related to: How to achieve transparent background or rounded corners when dragging a UICollectionViewCell
But how can I do this with SwiftUI?
My question related to: How to achieve transparent background or rounded corners when dragging a UICollectionViewCell
But how can I do this with SwiftUI?
From iOS 15, you can do this:
DraggedView()
.contentShape([.dragPreview], RoundedRectangle(cornerRadius: 20))
.onDrag(...)
I found a solution there: ContextMenu on a rounded LinearGradient produces sharp edges in SwiftUI
So, when I used contentShape
with onDrag
it works.