Picker()
Jan 16, 2024
- Picker() is an ideal component for any situation where a user needs to select options.
- Different styles and formats can be applied, each better suited to either large or smaller data sets.
1. Write a default picker code
2. Bind the string into selection
- change the tag number into string
- Create Text with Age and selected value in HStack
3. Use ForEach instead of writing one by one.
- Now picker has a number from 18 to 99
4. Stylize the Picker
- We can change the background
- Stylize the text inside
It’s working on .inline
- Use .pickerStyle()
- Slider
- Inline, allows the customization