Post not yet marked as solved
Post marked as unsolved with 0 replies, 1,126 views
I'm using Swift 2.0 and iOS 14.4. When adding a popover in my scrollview elements it shows in a wrong position. For Example: If I have multiple elements in my scrollview, it will show below the last element of the scrollview. Here's my code:
VStack {
ScrollView(.horizontal, showsIndicators: false, content: {
HStack {
ForEach(globalFilters, id: \.filterID) { filter in
if Utils.isIpad {
filterCell(filter, global: true)
.popover(item: $selectedFilter,
arrowEdge: .bottom, content: { aFilter in
if Utils.isIpad {
setFilterPopover(filter: aFilter, isPopover: true)
}
})
} else {
filterCell(filter, global: true)
}
}
ForEach(canvasFilters, id: \.filterID) { filter in
if Utils.isIpad {
filterCell(filter)
.popover(item: $selectedFilter,
arrowEdge: .leading,
content: { aFilter in
if Utils.isIpad {
setFilterPopover(filter: aFilter, isPopover: true)
}
})
} else {
filterCell(filter)
}
}
Spacer()
}.frame(height: 60).padding(.leading, 20)
})
}