adobe flex datagrid header background to an image

adobe flex datagrid header background to an image

Postby haretu » Tue Mar 22, 2011 11:31 am

Adobe flex This example shows how to change datagrid header background to an image through setting headerBackgroundSkin
main.mxml
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<s:Application name="Halo_DataGrid_headerBackgroundSkin_test"
               xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/halo" viewSourceURL="srcview/index.html">
   
    <mx:DataGrid id="dataGrid"
                 dataProvider="{Font.enumerateFonts(true)}"
                 headerBackgroundSkin="skins.CustomDataGridHeaderBackgroundSkin"
                 horizontalCenter="0" verticalCenter="0" />
   
</s:Application>


Skin
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin name="CustomDataGridHeaderBackgroundSkin"
             xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
             minWidth="21" minHeight="19">
   
    <!-- layer 1: fill -->
    <s:Rect left="0" right="0" top="0" bottom="0" alpha="0.6">
        <s:fill>
            <s:BitmapFill source="@Embed('pattern_149.gif')" />
        </s:fill>
    </s:Rect>
   
    <!-- layer 2: fill lowlight -->
    <s:Rect left="0" right="0" bottom="0" height="9">
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry color="black" alpha="0.0099" />
                <s:GradientEntry color="black" alpha="0.0627" />
            </s:LinearGradient>
        </s:fill>
    </s:Rect>
   
    <!-- layer 3: fill highlight -->
    <s:Rect left="0" right="0" top="0" height="9">
        <s:fill>
            <s:SolidColor color="white" alpha="0.33" />
        </s:fill>
    </s:Rect>
   
    <!-- layer 4: border - put on top of the fill so it doesn't disappear when scale is less than 1 -->
    <s:Rect left="0" right="0" bottom="0" height="1">
        <s:fill>
            <s:SolidColor color="#696969" />
        </s:fill>
    </s:Rect>
   
</s:SparkSkin>
Attachments
67_1.JPG
67_1.JPG (23.81 KiB) Viewed 858 times
haretu
 
Posts: 132
Joined: Sat Jan 08, 2011 9:56 pm

Return to Adobe FLEX Flash

Who is online

Users browsing this forum: No registered users and 1 guest

cron