搜索
首页php教程PHP开发Flex设置LinkButton的背景色有思路有源码

1、设计思路

由于Flex中没有设置LinkButton的背景色的属性,现在得从两个方面入手:第一,直接通过调用样式方法画出LinkButton的背景色;第二,设置LinkButton的背景图片。这里,讲述的是第一种方法

2、设计源码

<?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; 
 
/** 
* 初始化函数 
*/ 
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> 
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations> 
 
<mx:VBox width="100%"> 
<mx:LinkButton id="myLinkButton" label="查询" x="100" y="100"/> 
</mx:VBox> 
</s:Application>

3、设计结果

Flex设置LinkButton的背景色有思路有源码

更多Flex设置LinkButton的背景色有思路有源码相关文章请关注PHP中文网!

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

PhpStorm Mac 版本

PhpStorm Mac 版本

最新(2018.2.1 )专业的PHP集成开发工具

VSCode Windows 64位 下载

VSCode Windows 64位 下载

微软推出的免费、功能强大的一款IDE编辑器

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

螳螂BT

螳螂BT

Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具