ff10
ff10

Reputation: 3147

Change the text alignment for Eureka TextRow

I am looking for a way to change the textField text alignment. I have tried it with

cell.textField.textAlignment = .Left

but that doesn't change the alignment. It will always stay right aligned. I was wondering why this was the default, as Apple themselves use left aligned text inputs in most, if not all places.

Upvotes: 6

Views: 2473

Answers (1)

Zac Kwan
Zac Kwan

Reputation: 5757

For Eureka is a little different. You have to use cell update callback. It wasn't well documented about changing alignment. But it did mention here that to change color or font you will have to use the .cellUpdate. Thus, i believe this work will work for you:

let row = TextRow() {
    row.title = "Field:"
}.cellUpdate { cell, row in
    cell.textField.textAlignment = .left
}

Upvotes: 10

Related Questions