Post

Replies

Boosts

Views

Activity

Reply to Swift Form on iOS
Here is some standalone code with same behaviour you can try. I entered as a code block hope this works. Sincerely appreciate any input. // // ContentView.swift // TestDataEntry // import SwiftUI struct ContentView: View { @State private var newSourceName: String = "" var body: some View { editSource() } private func editSource() -> some View { NavigationStack{ Form { Section(header: Text("Source Name")) { TextEditor(text: $newSourceName) .font(.title3) .padding(5) .background( RoundedRectangle(cornerRadius: 10) .fill(.background) ) .textFieldStyle(PlainTextFieldStyle()) .frame(height: 50) .foregroundColor(.primary) } } HStack { Button("Save") { } Spacer() Button("Cancel", role: .cancel) { } } .padding() .layoutPriority(1) } #if os(macOS) .scrollDisabled(true) .padding() .frame(height: 180) .frame(width: 240) .background(.gray) #else .frame(width: 240) .frame(height: 240) #endif .cornerRadius(10) .clipShape(RoundedRectangle(cornerRadius: 10)) .overlay( RoundedRectangle(cornerRadius: 10) .stroke(Color.blue, lineWidth: 1) ) .zIndex(1) .onAppear() { } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Topic: Community SubTopic: Apple Developers Tags:
Feb ’25