Code: Select all
@ViewBuilder func customAvatarView() -> some View {
List {
ForEach(Array(sections.enumerated()), id: \.offset) { sectionIndex, element in
VStack(spacing: 0) {
Picker("\(element)", selection: $currentSelection[sectionIndex], content: {
DynamicFetchView(predicate: NSPredicate(format: "userID == %@", Auth.auth().currentUser!.uid), sortDescriptors: []) { (shopItems: FetchedResults) in
ForEach(shopItems.filter { $0.category == element }, id: \.self) { shopItem in
if let image = UIImage(named: shopItem.image ?? "") {
HStack {
Image(uiImage: image)
.resizable()
.frame(width: 150, height: 150)
.rotationEffect(Angle(degrees: 90))
}
}
}
}
})
.pickerStyle(.wheel)
.rotationEffect(Angle(degrees: -90))
.clipped()
.compositingGroup()
}
}
}
}

Vielen Dank im Voraus
Ich habe versucht, den Rahmen des Pickers, die LayoutPriorität, die ContentShape usw. zu ändern.
Mobile version