加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex中label换行

发布时间:2020-12-15 05:09:12 所属栏目:百科 来源:网络整理
导读:LABEL 怎么自动换行啊? myLabel.width=500 但是 由于内容太长? 会被自动撑开,并且不会换行 l.mx_internal::getTextField().wordWrap = true; mx:Script ? ![CDATA[ ?? [Bindable] ?? private var str:String? = ""; ?? private function startTest():void

LABEL 怎么自动换行啊?

myLabel.width=500

但是 由于内容太长? 会被自动撑开,并且不会换行
l.mx_internal::getTextField().wordWrap = true;
<mx:Script>
? <![CDATA[
?? [Bindable]
?? private var str:String? = "";
?? private function startTest():void
?? {
??? l.mx_internal::getTextField().wordWrap = true;
??? str = "123456789123456789";
?? }
??
? ]]>
</mx:Script>
<mx:Button click="{startTest()}"/>
<mx:Label id="l" x="199" y="163" width="70" text="{str}" height="51"/>
?


Flex中label换行
在as中赋值 label.text="aaaaa rn bbbbbbb"
在mxml中赋值 text="aaaaaa &#13; bbbbbbb"


<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
????? xmlns:s="library://ns.adobe.com/flex/spark"
????? xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">
<fx:Declarations>
?? <!-- Place non-visual elements (e.g.,services,value objects) here -->
</fx:Declarations>
<s:Label x="140" y="134" text="标&#13;签&#13;换&#13;行" width="31" height="107" backgroundColor="#C7E09F" fontSize="15" buttonMode="true" mouseChildren="false"/>

</s:Application>
?

?http://hi.baidu.com/miracle5460/blog/item/50aacd100f47320a203f2e48.html

http://bbs.airia.cn/thread-6038-1-1.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读