If I have white text in my UITextField, the selection window (when selecting text) is invisible because the background on the little window is also white.
Any way to fix this?
If I have white text in my UITextField, the selection window (when selecting text) is invisible because the background on the little window is also white.
Any way to fix this?
One solution that I've employed for this issue is to change the text color to a that will show up in the loupe (but may not look as good in the overall view) while editing and then changing it back to the better display color when finished editing.
It behaves as if you were highlighting the text of the field from a visual standpoint and allows you to use your preferred color for the display of the entered data when not editing.
Set the color to a highlight color that will have enough contrast in the loupe on didBeginEditing, then change it back on didEndEditing.
Just one other possible approach and one I've used in a couple of apps.
eg.
I'm afraid not. The problem's existed since the earliest days of the iPhone OS—white text appears as white-on-white in the cursor-positioning loupe as well. If this is a serious problem for your app, your only real options are to change the text color or to file a radar feature request with Apple.
Sure! The background color of the loupe always matches the
backgroundColor
property of the text field. (But not thebackground
property.) Example:If your text field absolutely requires a transparent background, you'll have to fake it—by using a background image containing the graphics underneath the text field. You may do it manually—by taking a screenshot of your interface and cropping it—or programmatically, like this:
Since the background is drawn on top of the background color, the text field will appear transparent, and you'll be able to use any background color you want for the loupe.
Glass takes color from textView.backgroundColor. So I made some dirty hack that works great:
I know this is a little old, but in iOS5, it appears to be a simulator-only issue. It will render correctly on the device.