1

私はフレックスモバイルアプリケーションでスパークリストを作成していますが、コーナー半径のあるiPhoneのリストのようにしたいと思います。残念ながら、リストスタイルにはcornerRadiusまたは単にradiusはありません。

ビューでリストを呼び出します。

  <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 を初めて使用するコーダー向けの 2 つのヒント... VBox、HBox、Canvas などの mx.containers で角を丸くしたい場合は、borderStyle を solid に設定し、borderThickness を 0 に設定してから、cornerRadius を任意の値に設定します。 . borderStyle を none (デフォルト) のままにしておくと、 cornerRadius 属性が壊れていて効果がないように見えます。

2 つ目のヒントは、パネルの上部と下部の角を丸くしたい場合、デフォルトで false に設定されている roundedBottomCorners というプロパティがあります。true に設定すると、上と下の両方が丸められます。

于 2011-06-02T13:19:29.887 に答える