ark.zv
ark.zv

Reputation: 23

How to set the cursor to end of the TextField? SwiftUI

I want to set the cursor to the end of the TextField like this image1

This is want I have image2

Can anyone give advice?

Upvotes: 1

Views: 2102

Answers (1)

ChrisR
ChrisR

Reputation: 12115

only this time :)

    Form {
        HStack {
            Text("User Name")
            TextField("user",text: $user)
                .multilineTextAlignment(.trailing)
        }
        HStack {
            Text("Password")
            TextField("password",text: $password)
                .multilineTextAlignment(.trailing)
        }
    }

Upvotes: 2

Related Questions