Home > AI > IOS > SwiftUI >

Divider

Example 1: divider + text + divider

struct ContentView: View {

    var body: some View {
        HStack {
            line
            Text("or").foregroundColor(.gray)
            line
        }
    }

    var line: some View {
        VStack {
            Divider().background(Color.gray).padding(20)
        }.padding(20)
    }
}

Leave a Reply