-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Description
Hi all, I have found a bug.
When using WaterdallGrid, if there are less than 2 data to display, nothing will be displayed.
Here is a piece of source code that reproduces the bug at my end
ScrollView {
WaterfallGrid(dataArray, id: \.self) { file in
VStack {
if let post = viewModel.posts.first(where: { $0.fileIds.contains(file.id) }) {
NavigationLink(destination: ImageDetailView(item: post, file: file)) {
// View to display images.
ImageGridItem(url: file.url!)
}
}
}
}
}
import SwiftUI
import Kingfisher
// View to display images.
struct ImageGridItem: View {
private var url: String
init(url: String) {
self.url = url
}
var body: some View {
KFImage.url(URL(string: url))
.resizable()
.placeholder{
RoundedRectangle(cornerRadius: 30)
.fill(Color(0xe6e6e6))
}
.scaledToFit()
.clipped()
.cornerRadius(5)
.aspectRatio(contentMode: .fit)
}
}
3 or more | less than two data |
---|---|
![]() |
![]() |
Please some advice or fix
adam-leitgeb
Metadata
Metadata
Assignees
Labels
No labels