Return Value 戻り値
A preview that uses the given layout.
Availability 有効性
Technology
func previewLayout(_ value: PreviewLayout
) -> some View
A preview that uses the given layout.
value
A layout to use for preview.
By default, previews use the Preview
layout, which places the view inside a visual representation of the chosen device. You can instead tell a preview to use a different layout by choosing one of the Preview
values, like Preview
:
struct CircleImage_Previews: PreviewProvider {
static var previews: some View {
CircleImage()
.previewLayout(.sizeThatFits)
}
}