2

I have a picker with segmentedPickerStyle and I want each section to have text and a small image. The problem is with the approach below I get 4 segments instead of 2. One for each text and one for each image. Is there any way to have the text and image together in one segment using only swiftui. I know I can create an image with text in the image but was wondering if there is a pure swiftUI way to do this using Text and Image

Picker(selection: $pickerSelection, label: Text("choose")) { HStack { Text("One") Image("firstImage") } .tag(0) HStack { Text("Two") Image("secondImage") } .tag(1) } .pickerStyle(SegmentedPickerStyle()) 
1
  • SegmentedPickerStyle can only display Text or Image not both. Commented May 6, 2021 at 11:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.