问题
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
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];
Please help me.
Thanks in advance!!!
回答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
回答2:
Change tint color of the text field.
来源:https://stackoverflow.com/questions/42341269/its-possible-to-change-default-selection-color-in-uitextfield-ios