Apache flex 禁用Flex 3中文本字段的滚动属性

Apache flex 禁用Flex 3中文本字段的滚动属性,apache-flex,macos,text,safari,Apache Flex,Macos,Text,Safari,在Mac OS X、Safari 4.0.2浏览器中,文本字段内容是可滚动的。如何停止文本字段的滚动属性 我已经明确提到了它的宽度,但没有提到高度。文本应在可用区域内相应地重新调整大小。请任何人提供解决方案 我过去曾将此用于此需求。只需将autoResize属性设置为true <?xml version="1.0" encoding="utf-8"?> <mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml">

在Mac OS X、Safari 4.0.2浏览器中,文本字段内容是可滚动的。如何停止文本字段的滚动属性

我已经明确提到了它的宽度,但没有提到高度。文本应在可用区域内相应地重新调整大小。请任何人提供解决方案

我过去曾将此用于此需求。只需将
autoResize
属性设置为
true

<?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>


您使用的是什么组件?火花文本输入?还是mx文本输入?还是完全不同的东西?你可以分享一些代码吗?你有机会尝试一下我发布的答案吗?如果它有助于解决您的问题,您可以通过单击“^”箭头向上投票,并通过单击“我的答案”旁边的复选标记图标将其标记为已接受的答案。