我的 SwiftUI 预览将一个视图显示为 3 个不同的预览屏幕,它应该是一个具有组合视图的屏幕...
我究竟做错了什么?
谢谢!
struct SignupSelfie: View {
@ObservedObject var signupImagesViewModel = SignupNavigationViewModel()
@State private var isValid = false
var body: some View {
VStack {
Button("capture") { /* action code here */ }
.background(
NavigationLink("", destination: SignupIdView(), isActive: $isValid)
)
}.navigationBarBackButtonHidden(true)
Spacer()
Text("capture selfie")
}
}
struct SignupSelfie_Previews: PreviewProvider {
static var previews: some View {
SignupSelfie()
}
}