1

我正在我的 flex 移动应用程序中创建一个 spark 列表,我想在 iphone 上做一个带有角半径的列表。不幸的是,列表样式中没有cornerRadius 或简单的半径。

我在视图中调用列表:

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

然后我调用 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>
</s:ItemRenderer>

那么如何在我的单元格上使用圆角半径呢?

4

1 回答 1

1

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

给刚接触 Flex 的程序员的两个提示...如果您想在 mx.containers 中使用圆角,例如 VBox、HBox、Canvas 等,请将borderStyle 设置为solid 并将borderThickness 设置为0,然后将cornerRadius 设置为您想要的任何值. 如果borderStyle 保留为none(默认),cornerRadius 属性似乎损坏且无效。

第二个技巧,如果你想在面板的顶部和底部使用圆角,有一个名为 roundedBottomCorners 的属性,默认为 false。设置为 true 时,您将看到顶部和底部均四舍五入。

于 2011-06-02T13:19:29.887 回答