问题
I am using Flex 4.5 and I want to set the maximum characters limit according to the textinput width means if user enter more character then the textinput width it should not accept those extra characters.
回答1:
unfortunately, i have no flex in front of me right now. You should know, how many space e.g. 20 characters needed and set this value to your textinput.width.
Check out the widthInChars-property for the spark Textinput. Maybe you can work with a litte offset. When it works, you just have to synchronize this value with maxChars. Let me know, if that work. Frank
来源:https://stackoverflow.com/questions/7309255/maxcharlimit-on-the-textinput-according-to-its-width