实时视图显示一个仅适合文本或视图内的任何内容的小框,它不显示完整的手机
这是代码
@State private var favoriteColor = "Red"
var colors = ["Red", "Green", "Blue"]
var body: some View {
VStack{
Picker(selection: $favoriteColor, label: Text("hey")) {
Text("hey2")
}
.pickerStyle(SegmentedPickerStyle())
Text("\(favoriteColor)")
}
}