objective c - UITextView Cursor Color not changing iOS 7 -
i'm trying set cursor color of uitextview based on user's preferences. select color want button.
by default, textview's cursor color white. when user presses button, might change green:
[_textview settintcolor:[uicolor greencolor]]; [_textview settextcolor:[uicolor greencolor]];
i sure method call working because textview's text changes color, not cursor...
i able recreate behavior: if change tint , text color while text view isn't selected (aka: not first responder), work expected.
but if first select it, tapping , change color button press, caret's (tint) color won't change.
here workaround:
- (ibaction)changecolor:(id)sender { [_textview settextcolor:[uicolor greencolor]]; [_textview settintcolor:[uicolor greencolor]]; if([_textview isfirstresponder]){ [_textview resignfirstresponder]; [_textview becomefirstresponder]; } }
Comments
Post a Comment