Reputation: 8845
By default, Xcode would use a device's screen to show live preview. For example:
How can I enable compact mode to only display the control I'm working with ?
Upvotes: 0
Views: 227
Reputation: 8845
Set .previewLayout(.sizeThatFits)
for the view you are previewing:
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
.previewLayout(.sizeThatFits)
}
}
Then you will see:
Upvotes: 1