欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Flex設(shè)置LinkButton的背景色有思路有源碼

 更新時(shí)間:2014年08月19日 09:56:05   投稿:whsnow  
Flex中沒(méi)有設(shè)置LinkButton的背景色的屬性,可以直接通過(guò)調(diào)用樣式方法畫出LinkButton的背景色

1、設(shè)計(jì)思路

由于Flex中沒(méi)有設(shè)置LinkButton的背景色的屬性,現(xiàn)在得從兩個(gè)方面入手:第一,直接通過(guò)調(diào)用樣式方法畫出LinkButton的背景色;第二,設(shè)置LinkButton的背景圖片。這里,講述的是第一種方法

2、設(shè)計(jì)源碼

<?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/mx" 
creationComplete="initHandler(event)"> 
<s:layout> 
<s:BasicLayout/> 
</s:layout> 
<fx:Script> 
<![CDATA[ 
import mx.events.FlexEvent; 

/** 
* 初始化函數(shù) 
*/ 
protected function initHandler(event:FlexEvent):void 
{ 
myLinkButton.graphics.beginFill(0x00FF00); 
myLinkButton.graphics.drawRect(0,0,myLinkButton.width,myLinkButton.height); 
myLinkButton.graphics.endFill(); 
} 

]]> 
</fx:Script> 
<fx:Declarations> 
<!-- 將非可視元素(例如服務(wù)、值對(duì)象)放在此處 --> 
</fx:Declarations> 

<mx:VBox width="100%"> 
<mx:LinkButton id="myLinkButton" label="查詢" x="100" y="100"/> 
</mx:VBox> 
</s:Application>

3、設(shè)計(jì)結(jié)果

相關(guān)文章

最新評(píng)論