Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the background of a textView to a dark color and continue to see clearly the text selection?

I would like to set the colors for a textView to dark to avoid to stress the eyes when working on text.

If I set for example the field background to be black and the text to be white, the text color selection becomes a bit hard to see.

This is the code I'm using:

    mainTextField.backgroundColor = UIColor.black
    mainTextField.textColor = UIColor.white

Is there a way to have te selection of the text more visible?

like image 338
Cue Avatar asked Oct 16 '25 11:10

Cue


1 Answers

I believe the text selection color is managed by the tintColor. You could set it to whatever you like by setting mainTextField.tintColor = UIColor.orange

like image 82
Ryan Poolos Avatar answered Oct 18 '25 07:10

Ryan Poolos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!