0

Default selection color is blue as - I required to change it clear color?


I know If I change tint color then that color will be set when I select ant text but my question When I set clear color as tint color then there should be no color displaying for selection of text but It is taking gray color as default.

if It is posiible then How? and please provide source code.


This is what happens when tint color is blue

enter image description here



if i set tintColor = clear color than display gray color.
This happens when tint color is set as clear color, its taking gray color as default that I dont want

textField.tintColor = [UIColor clearColor];

enter image description here

Please help me.
Thanks in advance!!!

Jitendra Modi
  • 2,344
  • 12
  • 34
Chandresh Kachariya
  • 667
  • 2
  • 13
  • 31

2 Answers2

1

Its not possible because if you change the cursor color to clear it will not show you the selected text so you have to pick some color for this. You can use a color wchich is very close to transparent by giving its RGB value.

Use below line of code

 textfield.tintColor = [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0];

It will look like this

enter image description here

Ali Farhan
  • 199
  • 1
  • 8
-1

Change tint color of the text field.enter image description here

Anuraj
  • 1,242
  • 10
  • 25