简体   繁体   中英

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.

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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM