InfoView(text: "핸드폰 번호를 입력해주세요", imageName: "phone.fill")
        .previewLayout(.sizeThatFits)

 

Preview에서  요로코롬 하면 안됨....

 

Xcode15이상부터

#Preview(traits: .sizeThatFitsLayout) {
    InfoView(text: "핸드폰 번호를 입력해주세요", imageName: "phone.fill")
}

 

이렇게 해야 한다고 합니다라ㅏ

 

 

https://stackoverflow.com/questions/74429078/swiftui-preview-layout-size-that-fits-does-not-work

 

SwiftUI preview layout: size that fits does not work

I want my preview to only have the size of the view and not show the whole iPhone. I have already tried it with this code: struct TimerCardView: View { var body: some View { Te...

stackoverflow.com

 

+ Recent posts