Setting foreground color deletes text in a field
Posted: Mon Apr 16, 2012 6:58 am
My app allows a user to enter text into a field and also to change the background colour. When a dark colour is chosen, my script changes the foreground colour to white to make it more readable. If the user selects a colour before entering any text, all works as expected (e.g. a red field with white text).
However, if the user enters text before choosing a colour, the background changes as expected but the text disappears. Text typed in at that point does appear as white (or black in the case of light colours). Changing just the background colour does retain the text -- it is only a change in foreground colour that deletes it. In the IDE the text does not get deleted -- only in the simulator and on an iPad.
So I tried storing the text in a variable, then putting it back in after the colour changes. But it simply does not appear even though I have proved that the variable does contain the text.
So, any clues what is happening here?
TIA
Don
However, if the user enters text before choosing a colour, the background changes as expected but the text disappears. Text typed in at that point does appear as white (or black in the case of light colours). Changing just the background colour does retain the text -- it is only a change in foreground colour that deletes it. In the IDE the text does not get deleted -- only in the simulator and on an iPad.
So I tried storing the text in a variable, then putting it back in after the colour changes. But it simply does not appear even though I have proved that the variable does contain the text.
So, any clues what is happening here?
TIA
Don