简体   繁体   中英

How do I make the SwiftUI canvas preview horizontal

I have tried to use.previewLayout(.fixed(width: 1334, height: 750)) syntax to make it look like Iphone8 screen horizontally(I don't know any other way,I remember on Xcode of previous version,I can choose device to be landscape left or landscape right or portrait for preview canvas), but it is not consistent with the actual simulator layout as the picture shows below.

but when it's Vertical, they both look the same.

How can I make them look the same when it is horizontal(landscape left or right)?

please help me, thanks a lot. Different pattern here

I have figured out that why they look different,It's because that I did not know the difference between the concept of points and pixels. Besides, SwiftUI does not support landscape mode!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM