Flex4¶¯Ì¬¼ÓÔØ Çл»CSS
Flex4Öж¯Ì¬¼ÓÔØCSSÎļþµÄ·½Ê½ÒѾºÍFlex3ÓÐÁËÒ»¶¨µÄÇø±ð
Ö÷Òª²½ÖèÈçÏ£º
1.±àд²»Í¬µÄCSSÎļþ
¼ûºóÎÄ
2.½«CSSÎļþ±àÒë³ÉSWFÎļþ
ÔÚFlashBuilderÖÐÓÒ¼üCSSÎļþ£¬Ñ¡ÔñCompile CSS to SWF£¬
Õâʱbin-debugĿ¼ÏµĶÔӦλÖþͻáÉú³ÉÒ»¸öÓëCSSͬÃûµÄSWFÎļþ¡£
Ñ¡Öкó¸ÃÑ¡ÏîÇ°»áÓй´£¬Ö®ºóÖ»ÒªÐÞ¸ÄÁËCSSÎļþ£¬¾Í»á×Ô¶¯±àÒë³ÉSWF
2.ÓÃstyleManager¼ÓÔØSWF
´úÂëÖÐÕâÑùд£º
this.styleManager.loadStyleDeclarations2("MyCss1.swf"); //´úÂëÖÐÌîдÉÏÒ»²½ÓÉCSSÉú³ÉµÄSWFÎļþ·¾¶
CSSд·¨£º
MyCss1.css
/* CSS file */
/*ÃüÃû¿Õ¼ä*/
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
/*ʹÓÃskinÀàÀ´¶¨ÒåƤ·ô£¬ËùÒÔÒªÓÃClassReferenceº¯Êý*/
s|List{
skin-class:ClassReference("skins.ListSkin1");
}
/*·ûºÅ#´ú±íÖ¸¶¨µÄID*/
s|Label#labelExamples{
font-size:14;
color:#990099;
}
s|CheckBox{
font-size:9;
color:#FF3300;
}
s|RadioButton{
font-size:92;
color:#990099;
}
s|Button{
font-size:32;
color:#FF3300;
}
×¢£ºCSSÖÐÎÞ·¨ÉèÖÃItemRenderer£¬ËùÒÔÈç¹ûҪʵÏÖ²»Í¬CSSÓò»Í¬µÄItemRenderer£¬Îª¸÷¸öCSSÖ¸¶¨²»Í¬µÄskinÀ࣬²¢ÇÒÔÚskinÀàÖзֱðÉèÖõÄItemRenderer
ÀýÈ磬ÎÒµÄÀý×ÓÖÐҪΪListÉèÖò»Í¬µÄItemRenderer£¬¾Í²»ÒªÐ´³É<s:List itemRenderer="itemRenderers.ListItemRenderer1".../>
¶øÒªÔÚCSSÖÐΪListÖ¸¶¨skinClassΪskins.ListSkin1£¬´úÂ룺skin-class:ClassReference("skins.ListSkin1");
È»ºó£¬ÔÚskin.ListSkin1ÖÐÉèÖÃItemRenderer£¬´úÂ룺
<s:DataGroup id="dataGroup" itemRenderer="itemRenderers.ListItemRenderer1">
<s:layout>...
MyCss2.css——ÁíÒ»¸öCSSÎļþ
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
/* ʹÓÃÁËÁíÒ»¸öSkinÀà*/
s|List{
skin-class:ClassReference("skins.ListSkin2");
}
s|Label#labelExamples{
font-size:42;
color:#009966;
}
s|CheckBox{
font-size:22;
color:#009966;
}
s|RadioButton{
font-size:20;
color:#009966;
}
s|Button{
font-size:12;
color
Ïà¹ØÎĵµ£º
ÓÐʱºòһЩ×ÊÁÏÖ»Äܸø±ðÈË¿´£¬Èç¿É´òÓ¡µÄÎĵµÈçDOC£¬PDF£¬µ«²»ÄÜÈÃÆäËûÎÞȨÏÞµÄÈËÁí´æ»òÕß´òÓ¡£¬ÌرðÊÇweb°æµÄÎļþ¹ÜÀíÀàµÄϵͳ£¬×ܻῼÂǵ½Õâ¸öÎÊÌâ¡£µ±ÓÃIEÖ±½Ó´ò¿ªpdfµÄʱºò£¬¾¡¹Ü¿ÉÒÔÆ£±ÖIEµÄÁí´æΪ£¬µ«Êǵã»÷PDFÎļþµÄʱºò£¬ÔÙ°´F8µÄʱºò£¬PDFµÄÔĶÁÆ÷È磨adobereader£©»áÏÔʾToolsBar£¬ËùÒÔÖ±½Ó´ò¿ªpdfòËÆÐв ......
ÓÃAccordion×é¼þµÄʱºò·¢ÏÖ,childÕ¹¿ªÖ®ºóÔÙµã»÷µÄʱºòûÓÐÏàÓ¦.
È»ºóÏ°¹ßÐÔµÄGoogle·¢ÏÖ½â¾ö·½·¨´óÖÂÊÇ×Ô¶¨ÒåÒ»¸ö×é¼þ...
¸Ð¾õΪÁËÒ»¸öС¹¦ÄÜÖØдÓеã ɱ¼¦ÓÃÅ£µ¶µÄ¸Ð¾õ.
ÓÚÊÇ×ÐϸÏëÁËÏÂ,·¢ÏÖÆäʵֻÐèÒªÖ¸¶¨headerµÄitemRenderer¼´¿É:
ÉÏ´úÂë headerRenderer="com.MyAccHeader"
MyAccHeader:
package com
{
......
2.2 ´úÂëʵÏÖ
ÏÂÃæ¸ø³öÁËFlexBuilder¹¤³ÌµÄÒ»¸öÎļþ£¬ÉèÖÃÁËFlashµÄ²¼¾Ö¡£
view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
......
¡¡¡¡×î½üÔÚ¿ª·¢¹ý³ÌÖз¢ÏÖÒ»¸öÎÊÌ⣺BooleanÀàÐ͵ÄÖµÎÞ·¨ÔÚflexºÍjava¼ä´«µÝ£¬¾¹ýÒ»¶ÎÑо¿·¢ÏÖ£¬ÎÊÌâ³öÏÖÔÚBooleanÀàÐ͵ÄgetterºÍsetter·½·¨ÉÏ¡£
°´ÕÕjavabeanµÄ¹æ·¶£¬Ð¡²¼¶ûÀàÐ͵ÄgetterÊÇÒÔis×öǰ׺µÄ£¬µ«ÊǴ󲼶ûÀàÐ͵Ägetter¾Í³ÉÁËÒÔgetΪǰ׺ÁË£¨´ó²¼¶û×÷ΪÒýÓÃÀàÐÍ£¬ÒѾ±»ÊÓΪÆÕͨ ......