
转载请保持文章完整性!
本文链接地址:http://blog.desizen.com/4lone/307.html
主页:joel's blog
这个例子进行的是UI Controls:Data Entry Controls:Text and TextArea
因为这三个例子都没有什么特别的地方,所以就放在了一起.
简介:
The Text control displays multiline, noneditable text. Use the Label control if you need only a single line of text. The Text control does not support scroll bars. If you need scrolling, you should use a non-editable TextArea control. You can format the text in a Text control using HTML tags, which are applied after the control’s CSS styles are applied. You can also put padding around the four sides of the text.
The TextArea control is a multiline text field with a border and optional scroll bars. The TextArea control supports the HTML rendering capabilities of Flash Player and AIR.
The TextInput control is a single-line text field that is optionally editable. All text in this control must use the same styling unless it is HTML text. The TextInput control supports the HTML rendering capabilities of Flash Player and AIR.
例子:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0" viewSourceURL="srcview/index.html"> <!--Text例子--> <mx:Panel title="Text Control" layout="vertical" color="0xffffff" borderAlpha="0.15" width="500" paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center"> <mx:Text width="100%" color="0x323232"> <mx:text> This is a multiline, non-editable text component. If you need an editable multiline component, use TextArea. </mx:text> </mx:Text> <mx:HRule width="100%" /><!--横向分割线--> <mx:Text width="100%" color="0x323232"> <mx:htmlText> <![CDATA[This is <font color="#EE1122">HTML text</font> in a <b>Text component</b>. Using the <u>htmlText attribute</u> of the <font color="#22A050">Text component</font> you can use basic HTML markup.]]> </mx:htmlText> </mx:Text> </mx:Panel> </mx:Application>
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0" viewSourceURL="srcview/index.html"> <mx:Panel title="TextArea Control" layout="vertical" color="0xffffff" borderAlpha="0.15" paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center"> <mx:TextArea width="400" height="60" color="0x323232"> <mx:text> This is a multiline, editable TextArea control. If you need a non-editable multiline control, use the Text control. </mx:text> </mx:TextArea> <mx:TextArea width="400" height="60" color="0x323232"> <mx:htmlText><![CDATA[This is <font color="#EE1122">HTML text</font> in a <b>TextArea control</b>. Use the <u>htmlText property</u> of the <font color="#22A050">TextArea control</font> to include basic HTML markup in your text.]]></mx:htmlText> </mx:TextArea> </mx:Panel> </mx:Application>
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0" viewSourceURL="srcview/index.html"> <mx:Panel title="TextInput Control" layout="vertical" color="0xffffff" borderAlpha="0.15" paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center"> <mx:TextInput id="src" text="Hello World!" color="0x323232"/> <mx:Button label="Copy Text" click="dest.text = src.text" color="0x323232"/> <mx:TextInput id="dest" color="0x323232"/> </mx:Panel> </mx:Application>
标签:FLEX, Text, TextArea, TextInput, TourDeFlex, 例子
