Post

Replies

Boosts

Views

Activity

Reply to Missing argument for parameter 'images' in call
Thanks so much, your first works great for me... But, how can I do the next step ? When I tapped on Landschaften that will be shows me Landschaften... That's nice. How can I do it for Maritimes? When I Tapped on Maritimes then I will that shows me Maritimes images... Can I drop more NavigationLinks in ContentView ? Have many Thanks ;) import SwiftUI struct ContentView: View {     var columns = [GridItem(.adaptive(minimum: 160), spacing: 5)]     var body: some View {         NavigationView {             ScrollView {                 LazyVGrid(columns: columns) {                     ForEach(ImagesList, id: \.id) { images in                         NavigationLink {                             LandView()                         } label: {                             ImageCard(images: images)                         }                     }                 }                 .padding(10)             }             .navigationBarTitle(Text("Übersicht"))         }         .navigationViewStyle(StackNavigationViewStyle())     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
Reply to Missing argument for parameter 'images' in call
Have a lot of thanks.... Of Course. Here ist Code for ImageCard.... import Swift UI struct ImageCard: View {     var images: Images     var body: some View {         NavigationView{             ZStack(alignment: .bottom) {                 Image(images.image)                     .resizable()                     .cornerRadius(18)                     .frame(width: 200)                     .scaledToFit()                 VStack(alignment: .leading)                 Text("\(images.category)")                     .frame(width: 200, height: 40, alignment: .center )                     .background(.ultraThinMaterial)                     .cornerRadius(18)                     .bold()             }             .frame(width: 200, height: 200)             .shadow(radius: 3)         }     } } struct ImageCard_Previews: PreviewProvider {     static var previews: some View {         ImageCard(images: ImagesList[0])     } } And here is the Code of my model import Foundation struct Images: Identifiable {     var id = UUID()     var name: String     var category: String     var image: String } var ImagesList = [Images(name: "Steinkirchen", category: "Landschaften", image: "Uebersicht_1"),                  Images(name: "Seacloud-Spirit",category: "Maritimes", image: "Uebersicht_2"),                  Images(name: "Grashalm", category: "Natur", image: "Uebersicht_3"),                  Images(name: "Details", category: "Projekte", image: "Uebersicht_4"),                  Images(name: "Festmacher", category: "Schwarz/Weiß",  image: "Uebersicht_5") ] struct Land: Identifiable {     var id = UUID()     var name: String     var category: String     var image: String } var LandList = [Images(name: "Helgoland", category: "Die Lange Anna", image: "Landschaften_1"),                 Images(name: "Thunersee",category: "Thunersee/Schweiz", image: "Landschaften_2"),                 Images(name: "Steinkirchen", category: "Das Alte Land", image: "Landschaften_3"),                 Images(name: "Steinkirchen", category: "Das Alte Land", image: "Landschaften_4"),                 Images(name: "Thunersee", category: "Thunersee/Schweiz", image: "Landschaften_5"),                 Images(name: "Steinkirchen", category: "Das Alte Land", image: "Landschaften_6") ] struct Maritimes: Identifiable {     var id = UUID()     var name: String     var category: String     var image: String } var MaritimesList = [Images(name: "Amerigo Vespucci", category: "3-Master", image: "Maritimes_1"),                 Images(name: "Festmacher",category: "Festmacher", image: "Maritimes_2"),                 Images(name: "Hapag", category: "Containerschiff", image: "Maritimes_3"),                 Images(name: "Fischkutter", category: "Kutter", image: "Maritimes_4"),                 Images(name: "Festmacher", category: "Festmacher", image: "Maritimes_5"),                 Images(name: "Seacloud-Spirit", category: "3-Master", image: "Maritimes_6") ] And there will be all correct, here is the code for import SwiftUI struct ContentView: View {     var columns = [GridItem(.adaptive(minimum: 160), spacing: 5)]     var body: some View {         NavigationView {             ScrollView {                 LazyVGrid(columns: columns) {                     ForEach(ImagesList, id: \.id) { images in                         NavigationLink {                             LandCard()                         } label: {                             ImageCard(images: images)                         }                     }                 }                 .padding(10)             }             .navigationBarTitle(Text("Übersicht"))         }         .navigationViewStyle(StackNavigationViewStyle())     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } Have so many thanks, for helping me on this weekend... Greeting from Germany
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
Reply to Missing argument for parameter 'images' in call
Vielen Dank, das war eine schnelle Antwort. Schön... Das nächste "Problem" ist also, dass die Karten doppelt so hoch sind... (Siehe Anhang) Meine Frage ist also, wie kann ich das beheben? Und das nächste ist. Ich werde tun, dass ich auf LandCard getippt habe, es wird zu LandView gehen. Das Gleiche gilt für Maritimes. Ich werde auf die MaritimesCard tippen, es wird zu MaritimesView gehen. Ich weiß, dass das so weitergehen muss, aber tut mir leid, ich bin neu bei Swift Ui ;) Vielen Dank für Ihre Hilfe...
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22