Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 847
ff10 Avatar asked Jul 06 '16 18:07

ff10


1 Answers

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
}
like image 83
Zac Kwan Avatar answered Oct 06 '22 01:10

Zac Kwan