Can anyone think of a reason that the blinking cursor would not show up in a UITextView
? I have a custom control that is just a subclass of UIView
and it has a UITextView
in it, but the cursor doesn't appear when it gets focus. The keyboard appears, and the text appears as you type, but there is no cursor, and I can't figure out why.
Any thoughts?...
You may have changed the tint color in your custom UITextView. If the tint color is the same as the background color (normally white), then it will appear invisible.
You might be setting improperly a contentSize
and/or frame for the component so it is too small to be visible or the control is out of the screen. Please go in Simulator to Debug->Color Blended Layers
to see whether those values are set correctly.
EDIT:
With new Xcodes (probably introduced in Xcode 6) you can debug this kind of issues by clicking "Debug View Hierarchy" (it is one of the icons on the bottom bar)
The textfield is showing the cursor but you are not able to see the color, just because the tint color of your text field is set to default most probably as in my case it was. Just select you textField in storyboard and Select the link color of your wish. Refer to the image attached.
I changed the tint color of all of my UITextViews and the cursor started showing on the next build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With