HomeiOS Developmentios - SwiftUI horizontal wheel picker cell merchandise dimension

ios – SwiftUI horizontal wheel picker cell merchandise dimension


I am at the moment making an attempt to realize a horizontal picker view the place the consumer can choose its avatar shirt. The rotation and changes of the picker works tremendous however my chosen picker view cell dimension doesn’t resize to the precise picture dimension of my gadgets array. This results in overlapping of my gadgets. I’ve tried lots, however is there a solution to repair this or is that this a typical concern in iOS 16.4?

    @ViewBuilder func customAvatarView() -> some View {
        Checklist {
            ForEach(Array(sections.enumerated()), id: .offset) { sectionIndex, factor in
                VStack(spacing: 0) {
                    Picker("(factor)", choice: $currentSelection[sectionIndex], content material: {
                        DynamicFetchView(predicate: NSPredicate(format: "userID == %@", Auth.auth().currentUser!.uid), sortDescriptors: []) { (shopItems: FetchedResults<ShopData>) in
                            ForEach(shopItems.filter { $0.class == factor }, id: .self) { shopItem in
                                if let picture = UIImage(named: shopItem.picture ?? "") {
                                    HStack {
                                        Picture(uiImage: picture)
                                            .resizable()
                                            .body(width: 150, top: 150)
                                            .rotationEffect(Angle(levels: 90))
                                    }
                                }
                            }
                        }
                    })
                    .pickerStyle(.wheel)
                    .rotationEffect(Angle(levels: -90))
                    .clipped()
                    .compositingGroup()
                }
            }
        }
    }

enter image description here

Thanks upfront

I attempted altering the body of the picker, the layoutPriority, the contentShape and so on..

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments