flex大小自适应 ggg
来源:互联网 发布:淘宝网压缩面膜 编辑:程序博客网 时间:2024/05/01 21:57
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:flexer="com.flexer.*"> <mx:TextArea id="inputText" x="10" y="61" width="444" height="150"/> <flexer:AutoResizeableTextArea id="respText" x="10" y="219" width="222" autoResize="true" text="{inputText.text}"/> <mx:Text x="10" y="10" text="Put some text in this text area and the one bellow will resize according to the 
qunatity of text insered. You can copy text from anywhere (i used text from 
http://www.lipsum.com/feed/html). You can even copy this text." width="444" height="49"/></mx:Application>
?xml version="1.0" encoding="utf-8"?><mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ // auto resize setting private var _autoResizable:Boolean = false; // getter [Bindable(event="changeAutoResize")] public function get autoResize():Boolean { return _autoResizable; } // setter public function set autoResize(b:Boolean):void { _autoResizable = b; // if the text field component is created // and is auto resizable // we call the resize method if (this.mx_internal::getTextField() != null && _autoResizable == true) resizeTextArea(); // dispatch event to make the autoResize // property bindable dispatchEvent(new Event("changeAutoResize")); } // setter override override public function set text(value:String):void { // calling super method super.text = value; // if is auto resizable we call // the resize method if (_autoResizable) resizeTextArea(); } // resize function for the text area private function resizeTextArea():void { // initial height value // if set to 0 scroll bars will // appear to the resized text area var totalHeight:uint = 10; // validating the object this.validateNow(); // find the total number of text lines // in the text area var noOfLines:int = this.mx_internal::getTextField().numLines; // iterating through all lines of // text in the text area for (var i:int = 0; i < noOfLines; i++) { // getting the height of one text line var textLineHeight:int = this.mx_internal::getTextField().getLineMetrics(i).height; // adding the height to the total height totalHeight += textLineHeight; } // setting the new calculated height this.height = totalHeight; } ]]> </mx:Script></mx:TextArea>
- flex大小自适应 ggg
- 关于flex大小的自适应
- flex 组件大小窗口自适应
- Flex/AS 文字自适应大小
- Flex TextArea自适应位置及大小
- ggg
- ggg
- ggg
- GGG
- ggg
- ggg
- ggg
- ggg
- ggg
- ggg
- ggg
- ggg
- ggg
- 孙思邈的养生十三法
- 分数线出来了
- Django笔记-Forms
- 动态生成DropDownList
- 河北落后的真实原因
- flex大小自适应 ggg
- 为什么中国一直人口众多
- 这简历行啵?
- 1993年:海南房地产泡沫破裂
- VS2008工程转化为VS2005工程
- 学习PMP笔记
- 2009年java笔试题(亲身面试过的)
- SqlDataSource参数化查询所有记录
- 进程间同步临界区的Peterson算法