Advertisement
matt95

TextField SwiftUI Unexpected Behaviour

May 11th, 2020
1,430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.49 KB | None | 0 0
  1. import SwiftUI
  2.  
  3. struct ContentView: View {
  4.    
  5.     @State var name: String = ""
  6.     @State var active: Bool = false
  7.  
  8.     init() {
  9.         UIScrollView.appearance().backgroundColor = UIColor(named: "background")
  10.     }    
  11.  
  12.     var body: some View {
  13.         NavigationView {
  14.             ScrollView {
  15.                 Group {
  16.                     TextField("Name", text: $name).padding().background(Color("Color")).cornerRadius(8).padding()
  17.                 }
  18.             }
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement