【问题标题】:Set a corner radius on a spark list Flex 4 air mobile在火花列表 Flex 4 air mobile 上设置角半径
【发布时间】:2011-06-01 07:32:40
【问题描述】:

我正在我的 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>

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

【问题讨论】:

    标签: apache-flex mobile flex4 air cornerradius


    【解决方案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 时,您将看到顶部和底部均四舍五入。

    【讨论】:

    • 请将相关部分粘贴到您的答案中,这样如果该博客出现故障,仍然可以在此处访问!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-25
    • 1970-01-01
    • 2011-05-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多