I have a picker like the following that has a frame width of 150. I need the text to fit inside the picker, but the lineLimit()
, scaledToFit()
and scaledToFill()
do not do anything on the picker object.
@State var Status: String = ""
Picker(selection: $Status, label:
Text("Status")) {
Text("yyyyyyyyyyyyyyyyyyyyyyyyyyyyy").tag(0)
.lineLimit(2).scaledToFit().scaledToFill()
Text("zzzzzzzzzzzzzzzzzzzzzzzzzzzzz").tag(1)
.lineLimit(2).scaledToFit().scaledToFill()
}.frame(maxWidth: 150, minHeight: 50, maxHeight: 50, alignment:.center)
.background(Color.gray)
.lineLimit(2)
.scaledToFit()
What is the correct way to scale and fit selected text inside the picker?
Thank you for any help!!