Post

Replies

Boosts

Views

Activity

ListView with personal data
I will briefly explain my view. My goal is to make a list where you can enter all personal information like a kind of emergency passport. There should also be text fields where you can tap on the plus button and then there is a new text field. On the top right I want to make an edit button that you can delete text fields again. I will connect this view with another SwiftUI view file. Does anyone have an idea how to solve this problem with the list? import SwiftUI struct ListeDaten: Identifiable { let id = UUID() let Name: String let Adresse: String var Telefonnummern: [String] = [] var Something: String = "" } struct ListeDaten: View {     var body: some View {                  TextField(Name: "Name/Vorname")         TextField(Adresse: "Adresse")         ForEach(id: \.self) {Telefonnummern in TextField("Telefonnummer")}         Button(action: {             Telefonnummern.append("")         })         {             Image(systemName: "plus.circle.fill")                 .foregroundColor(Color(.systemGreen))         }     } } struct ListeDaten_Previews: PreviewProvider {     static var previews: some View {         ListeDaten()     } }
0
0
684
Jan ’22
Action Button(Textfield)
Good day, I would like to generate a text field when I tap on the green button that creates a new text field and I can still enter for example a 2nd phone number. I have already tried it with this example: Button(action: { print("Telefonnummer")}) {          Image(systemName: "plus.circle.fill")                 .foregroundColor(Color(.systemGreen)) }
8
0
2.8k
Jan ’22
NavigationLink issue
Good day, I have the problem that when I switch from one view to another, the content is moved to the bottom every time. I have already tried with the: See picture attached: [https://we.tl/t-SUYZZh6M2P) Does anyone have a solution suggestion? Greetings
4
0
1k
Dec ’21