How to change UITableView Label to mutiple color

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How to change UITableView Label to mutiple color



How do I change the text in my UITableView to two different colors?


let highest = (history[indexPath.row].highest!) //Red color
let lowest = (history[indexPath.row].lowest!) //Green color
cell.detailTextLabel?.text = "$(highest)/$(lowest)"

return cell



Thank you!





use attributed text for this use two colors one for lowest and other highest
– Vinodh
3 mins ago




1 Answer
1



You can prepare a custom view with two labels, one for highest, other for lowest.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

WI8B8Ts033ADC8,PyPNvF2J hw 1EsrufTGKL7VnIv1E DIE2PoacozMz1YfGWLLm2 MoYEVVZ
MFy6,WWA6ZFpA9 ALqIZVg6 CCE3YMsy3O8pW3xJb duAa4L1 8L,miPK8h8IJp4o

Popular posts from this blog

Makefile test if variable is not empty

Visual Studio Code: How to configure includePath for better IntelliSense results

Will Oldham