在火花列表 Flex 4 空中移动设备上设置角半径

发布于 2024-11-11 18:08:53 字数 1144 浏览 9 评论 0原文

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

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

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>
</s:ItemRenderer>

So how can I use corner radius on my cells?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜夜流光相皎洁 2024-11-18 18:08:53

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 时,您将看到顶部和底部都被舍入。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文