开发者

Set a corner radius on a spark list Flex 4 air mobile

开发者 https://www.devze.com 2023-03-09 21:38 出处:网络
I\'m creating a spark list in my flex mobile application and i want to do like a list on the iphone with a corner radius.

I'm creating a spark list in my flex mobile application and i want to do like a list on the iphone with a corner radius. Unfortunately there is no cornerRadius or simply radius in list styles.

I call a list in a view:

  <s:List id="language" width="100%" height="70" borderVisible="true"
                    change="navigator.pushView(LanguageView)" dataProvider="{languageCell}"
                    itemRenderer="skins.CustomCellStyle1"/>

Then I call itemRenderer:

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                width="100%" height="70">
    <s:HGroup width="100%" verticalCenter="0" paddingLeft="15" paddingRight="15">
        <s:Label text="{data.label}"/>
        <s:Spacer width="100%"/>
        <s:Label text="{data.content}" 
                 textAlign="right"
                 color="0x046380" paddingRight="5"/>        
        <s:BitmapImage id="icon"
                       source="{data.mark}"
                       verticalCenter="0"/>
    </s:HGroup开发者_JS百科>
</s:ItemRenderer>

So how can I use corner radius on my cells?


http://viconflex.blogspot.com/2008/05/sometimes-cornerradius-just-isnt-enough.html

Two tips for coders new to Flex... if you want to have rounded corners in mx.containers like VBox, HBox, Canvas, etc, set the borderStyle to solid and the borderThickness to 0, and then set your cornerRadius to whatever you want. If the borderStyle is left at none (default), the cornerRadius attribute seems broken and ineffective.

The second tip, if you want rounded corners at the top and bottom of your Panel, there's a property called roundedBottomCorners which defaults to false. When set to true, you will see rounding both top and bottom.

0

精彩评论

暂无评论...
验证码 换一张
取 消