The live view shows a tiny box that just fits the text or whatever inside the view it doesn't show a full phone
here is the code
@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)")
}
}
In your attached image, you show some code that you didn't actually include in your question. In it, you initialize a
UIHostingControllerwith a certain size, but then never do anything with it -- instead, you set the playground view to justContentView.You can make the
ContentViewappear with a larger frame by adding aframemodifier to it: