首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Flex VBox边框

Flex VBox边框
EN

Stack Overflow用户
提问于 2010-10-05 05:38:31
回答 3查看 9.8K关注 0票数 1

如何在Flex VBox中添加边框?我的VBoxList的渲染器。我尝试了以下方法,但没有成功(特别是VBoxborderVisible="true" borderStyle="solid" borderColor="0x888888"):

代码语言:javascript
复制
 <mx:List id="myList" dataProvider="{myData}"
     width="100%" height="100%"
     variableRowHeight="true"
     verticalScrollPolicy="auto" horizontalScrollPolicy="auto">
     <mx:itemRenderer>
         <mx:Component>
             <mx:VBox
                 width="100%" height="100%"
                 verticalScrollPolicy="off" horizontalScrollPolicy="off"
                 borderVisible="true" borderStyle="solid" borderColor="0x888888">
                 <mx:HBox width="100%">
                     <mx:Label id="firstNameLabel" text="{data.firstName}"/>
                     <mx:Label id="lastNameLabel" text="{data.lastName}"/>
                 </mx:HBox>
                 <mx:Text id="descriptionLabel" text="{data.description}"/>
             </mx:VBox>
         </mx:Component>
     </mx:itemRenderer>
 </mx:List>
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2010-10-05 11:00:59

Flex Container类上没有borderVisible样式或属性。

要查看边框,您需要设置borderStyleborderColorborderThickness样式。

为您的VBox尝试以下样式:

代码语言:javascript
复制
         <mx:VBox
             borderThickness="1" borderStyle="solid" borderColor="0x888888" ...>

             ...

         </mx:VBox>
票数 6
EN

Stack Overflow用户

发布于 2010-10-07 02:14:12

在actionscript 3中:

代码语言:javascript
复制
private var _vbox:VBox;

...

this._vbox.setStyle("borderThickness", "1");
this._vbox.setStyle("borderStyle", "solid");
this._vbox.setStyle("borderColor", "0x888888");
票数 2
EN

Stack Overflow用户

发布于 2010-10-05 12:52:04

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        private var myData:ArrayCollection = new ArrayCollection([
            {label:'a11',url: '../dol/assets/images/lalign.png', side:'left'},
            {label:'a323',url: '../dol/assets/images/calign.png', side:'center'},
            {label:'asdf45',url: '../dol/assets/images/ralign.png', side:'right'}]);
        ]]>
</mx:Script>
    <mx:List id="myList" dataProvider="{myData}"
     width="100%" height="100%"
     variableRowHeight="true"
     verticalScrollPolicy="auto" horizontalScrollPolicy="auto">
     <mx:itemRenderer>
         <mx:Component>
             <mx:VBox width="100%" height="100%"
                 verticalScrollPolicy="off" horizontalScrollPolicy="off"
                 borderStyle="solid" borderColor="0x888888" borderThickness="3">
                 <mx:HBox width="100%">
                     <mx:Label id="firstNameLabel" text="{data.label}"/>
                     <mx:Label id="lastNameLabel" text="{data.url}"/>
                 </mx:HBox>
                 <mx:Text id="descriptionLabel" text="{data.side}"/>
             </mx:VBox>
         </mx:Component>
     </mx:itemRenderer>
 </mx:List>
</mx:Application>

borderVisible在flex中为nothing,请使用borderStyle=solid、borderThickness和borderColor属性显示边框

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3859348

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档