根据宽度设置 TextInput 上的 MaxCharLimit [英] MaxCharLimit on the TextInput according to it's width

查看:16
本文介绍了根据宽度设置 TextInput 上的 MaxCharLimit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Flex 4.5,我想根据 textinput 宽度设置最大字符数限制,这意味着如果用户输入更多字符,则 textinput 宽度不应接受这些额外字符.

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.

推荐答案

不幸的是,我现在没有弹性.你应该知道,有多少空间,例如需要 20 个字符并将此值设置为您的 textinput.width.

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.

查看 spark Textinput 的 widthInChars 属性.也许你可以用一点偏移量来工作.当它工作时,您只需将此值与 maxChars 同步.如果那行得通,请告诉我.弗兰克

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

这篇关于根据宽度设置 TextInput 上的 MaxCharLimit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆