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

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

If I set, for example, that the background of the background is black and the text is white, choosing the color of the text becomes a little difficult.

This is the code I am using:

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

      

Is there a way to make te text selection more visible?

+3


source to share


2 answers


I believe the highlight color of the text is controlled by the tintColor. You can install it however you want by settingmainTextField.tintColor = UIColor.orange



+2


source


The highlight color of the selected UITextView text is determined by either the global or the view tint color.

You can set the color in the Storyboard by going to the file inspector and setting the global tint color, or in the UITextView's attribute inspector to apply it specifically for that view.

Attributes Inspector Tint Color



I also suggest you set the text color for the light text color.

Attributes Inspector Text Color

+2


source







All Articles