In Flash Builder, on a flex mobile app for iOS, I have a text field that is supposed to have text that resizes to fill it. It works fine on the AIR simulator, but doesn’t work on a device or the iOS simulator.
The output confirms that the text size is being changed, but it doesn’t display as long as the textfield has the focus.
I added a button that changes the font size – that works fine, and displays changes immediately. the code works fine on android also, so this appears to be an iOS specific issue – text is not updated while the textfield is selected.
The code snippet is from the custom skin on the textfield. Doesn’t render til deselect.
textDisplay.setStyle("fontSize",oldfont+1);
textDisplay.text = "Insert text here"
hostComponent.invalidateSkinState();
hostComponent.validateNow();
Button code (in same file as textField, not in the skin code, obviously). Renders immediately (including the resizing that is done by the code in the skin)
<s:Button click="inputField.text='Insert text here'"/>
Any help would be appreciated, thanks.
We solved the problem: the skin class uses the native text field. In the case of iOS, this only loads font styles on initiation. We ended up not using a skin at all, and instead wrote everything through change handlers.