Line limit in TextEditor (SwiftUI) not working

Viewed 915

I've seen a lot of answers that simply say to use the limit limit view modifier but it doesn't seem to work:

mport SwiftUI

struct TextEditorTest: View {
    
    @State var text: String = "Type in here"
    
    var body: some View {

        VStack {
                            
                Text("Sample Text A")
                
                TextEditor(text: $text)
                    .lineLimit(3)
                
                Spacer()
        }
    }
}

struct TextEditorTest_Previews: PreviewProvider {
    static var previews: some View {
        TextEditorTest()
    }
}

enter image description here

0 Answers
Related