Jinxiansen/SwiftUI

Picker example

muhammadelkady25 opened this issue ยท 6 comments

Could you provide a picker example containing for example list of chars [A..Z] or lis of numbers [0..9]

@muhammadelkady25

Of course, please wait a few minutes for me.

Picker

I have added the Picker usage example, as shown above.
You can download the project to view the source code.
https://github.com/Jinxiansen/SwiftUI#Picker

Thank you very much for your help

โ‰–โ€ฟโ‰–

@Jinxiansen another thing .. in the example the second picker overlaps the first one .. the area in the middle (2 gray lines overlaps each other) .. I have six pickers. The last one receives touch in the overlapped area. how to give it a fixed width ?

 Picker(selection: $firstLetterIndex, label: Text("")) {
                    ForEach(0..<letters.count) {
                        Text(self.letters[$0]).tag($0)
                    }
                }.fixedSize().frame(width: 20)

This did not work for me

Jietu20190612-223205@2x

I tried to arrange 6 Pickers horizontally, which caused the top 5 Texts to not display properly, and when the first Picker swung up and down, it responded with the value of the third Picker. Maybe this is a bug in SwiftUI.๐Ÿ˜‚