我想要一个恒定的标签,但我的选择器标签会根据我选择的值而变化。
我的代码:
Picker(
selection : $textBoxes[currentIndex].textFont,
label : Text("Font"),
content : {
Text("LuxuriousRoman-Regular").tag("LuxuriousRoman-Regular")
Text("Merriweather-Regular").tag("Merriweather-Regular")
Text("Neonderthaw-Regular").tag("Neonderthaw-Regular")
Text("OpenSansCondensed-Light").tag("OpenSansCondensed-Light")
Text("Pacifico").tag("Pacifico")
Text("PTSans-Regular").tag("PTSans-Regular")
Text("RobotoMono-VariableFont_wght").tag("RobotoMono-VariableFont_wght")
Text("SedgwickAve-Regular").tag("SedgwickAve-Regular")
}
).pickerStyle(MenuPickerStyle())
Run Code Online (Sandbox Code Playgroud)