apache-flex - Adobe Flex 列表项目渲染器 : Cannot Scroll List

标签 apache-flex list adobe itemrenderer

我已经成功设置了一个列表,该列表可以从数据库中提取用户并将其显示在列表中。我目前正在使用 itemrenderer 自定义列表,一切进展顺利。我可以提取用户的个人资料图片,然后在其右侧显示他们的姓名,下面是他们的年龄。问题是我只能将 4 个结果放入列表中,并且可以看到第 5 个结果的顶部,但没有滚动条。我会显示一个打印屏幕,但我用有关我的 friend 及其 Facebook 详细信息的真实信息填充了我的数据库,所以我宁愿不这样做。

在我的主 mxml 程序中,我有以下代码:

<s:List id="resultList" includeIn="loggedin" x="120" y="246"
      width="100%" itemRenderer="userList">   
    <s:layout>  
        <s:VerticalLayout useVirtualLayout="true" requestedMinRowCount="1"/>  
    </s:layout>  
    <s:AsyncListView list="{getUserResult.lastResult}"/>  
</s:List>

userList.mxml中,我有以下代码:

<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                xmlns:s="library://ns.adobe.com/flex/spark" 
                xmlns:mx="library://ns.adobe.com/flex/mx" 
                autoDrawBackground="true">  
    <s:Image id="fbImg" source="http://graph.facebook.com/{data.facebookid}/picture?type=normal" x="0" y="0"/>  
    <s:Label id="usernameLbl" x="120" y="0" fontFamily="Calibri" fontSize="25" fontWeight="bold" text="{data.firstname} {data.lastname}"/>  
    <s:Label id="ageLbl" text="{data.dob}" x="120" y="40" />  
</s:ItemRenderer>

有人知道为什么我无法滚动所有结果吗?我确信这是一些我不知道的非常简单的事情。
编辑:我对糟糕的格式感到非常抱歉。我似乎无法让我的代码很好地显示。

最佳答案

为您的列表指定一个高度,世界上一切都会好起来的。如果您不这样做,它会假设它可以延伸到页面底部以显示所有数据,即使您看不到它。

<s:List id="resultList" includeIn="loggedin" x="120" y="246"
  width="100%" height="100%" itemRenderer="userList">   
<s:layout>  
    <s:VerticalLayout useVirtualLayout="true" requestedMinRowCount="1"/>  
</s:layout>  
<s:AsyncListView list="{getUserResult.lastResult}"/>  

附注很好的问题,有很多细节和完美的代码量。

关于apache-flex - Adobe Flex 列表项目渲染器 : Cannot Scroll List,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10505099/

相关文章:

apache-flex - 是否可以在 Flash 或 Flex 中重视存储 cookie?

apache-flex - 向警报文本添加新行

actionscript-3 - 如何在 Android/Black berry 的 Air 中打开 pdf

android - 适用于 Android 的 Adob​​e AIR 上的 Pinless OAuth

apache-flex - 用flex或flash监视USB端口的最佳方法是哪种?

xml - 如何从 xml 获取节点而不知道其在 flex 中的级别?

apache-flex - 如何将图标添加到 AdvancedDataGrid 列标题并保留文本的自动换行功能

python - 如何在列表理解中转换这个 for 循环?

python - 在 Tkinter 中制作鼠标悬停事件函数列表

python - 使用 Python 将列表字典转换为 CSV 文件