开发者

Flex 4 - How to draw or place a border around both the checkbox and label portion of the CheckBox

开发者 https://www.devze.com 2023-02-02 12:09 出处:网络
I have been doing much research on this - including creating a custom skin but cannot seem to be able to do it.I just want to have one border around both the checkbox and label. I also want a backgrou

I have been doing much research on this - including creating a custom skin but cannot seem to be able to do it. I just want to have one border around both the checkbox and label. I also want a background color which I did manage to via opaqueBackground property (setting it via AS3). Just can't seem to find the key to have a border as开发者_运维知识库 well. Any help is appreciated. I need the same for radio buttons as well.


You're on the right track by creating a custom skin. Just copy the default CheckBoxSkin and add a Rect at the top level so it gets drawn first (below where the states are declared and before the first Group):

<s:Rect left="0" right="0" top="0" bottom="0">
    <s:stroke>
        <s:SolidColorStroke color="#ff0000"/>
    </s:stroke>
</s:Rect>

Then set your new skin as the checkbox skin, either in CSS or directly on the specific checkbox via its skinClass.

Hope that helps.

0

精彩评论

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

关注公众号