【问题标题】:Adobe Flex Show Content inside Rectangle (itemRenderer)Adobe Flex 在矩形内显示内容 (itemRenderer)
【发布时间】:2015-10-02 09:20:14
【问题描述】:

我有一个简单的问题,但首先我描述一下场景:

刚刚写了我的第一个 ItemRenderer 用于测试假设。我在我的应用程序中获得了一个用户列表视图,并在其上的 dataprovider 中声明了一些对象。在itemRenderer 上,我想在 TileGroup 中的矩形内显示每个对象(具有名称和图标的用户)。我现在的问题是,矩形显示在(用户)对象旁边而不是它周围,并且不允许在矩形内声明组件。

这是我itemRenderer的代码:

<s:TileGroup requestedColumnCount="4" requestedRowCount="1">
    <s:Rect id="infoRect" width="100%" height="100%" left="0" right="0">
        <s:stroke>
            <s:SolidColorStroke color="0xFFFFFF" weight="1" />
        </s:stroke>
        <s:fill>
            <s:SolidColor color="white" />              
        </s:fill>
    </s:Rect>

    <s:VGroup width="100%" height="100%">
        <s:Label id="labelName" text="Name: {data.Name}"
                 color="red" />
        <s:Label id="labelVerbindung" text="Verbindung: {data.Verbindung}"
                 color="red" />
        <s:BitmapImage id="labelIcon" source="{data.Icon}" />
    </s:VGroup> 
</s:TileGroup>

作为解决方法,我尝试使用简单的 CSS 并为 VGroup 提供以下属性 styleName=".borderClass",但也没有效果:

<fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    .borderClass {
        border-style: solid;
        border-width: 3px;
        border-color: red;
    }
</fx:Style>

关于如何解决这个问题的任何建议?

【问题讨论】:

    标签: css apache-flex adobe border mxml


    【解决方案1】:

    好吧,我只是愚蠢...只是使用 BorderContainer 而不是 Rectangle,它工作得非常好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-05
      • 2018-01-11
      • 2013-10-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多