“Kesalahan dengan pratinjau @FocusState SwiftUi” Kode Jawaban

Kesalahan dengan pratinjau @FocusState SwiftUi

// The workaround I found here is to wrap the preview in a ZStack, like so:
// @anarchymedes
@MainActor
struct TripInfoView_Previews: PreviewProvider {
    @StateObject static var currenttrip: TripStore = TripStore.instance
    static var previews: some View {
        ZStack {
            TripInfoView(currenttrip: currenttrip, tripPartIndex: .constant(0), signalclosure: nil, readOnlyMode: .constant(false)).environmentObject(currenttrip)
        }
    }
}
Shiny Shark

Kesalahan dengan pratinjau @FocusState SwiftUi

@MainActor
struct TripInfoView_Previews: PreviewProvider {
    @StateObject static var currenttrip: TripStore = TripStore.instance
    static var previews: some View {
        ZStack {
            TripInfoView(currenttrip: currenttrip, tripPartIndex: .constant(0), signalclosure: nil, readOnlyMode: .constant(false)).environmentObject(currenttrip)
        }
    }
}
Shiny Shark

Jawaban yang mirip dengan “Kesalahan dengan pratinjau @FocusState SwiftUi”

Pertanyaan yang mirip dengan “Kesalahan dengan pratinjau @FocusState SwiftUi”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya