简体   繁体   English

flex 4 list没有可选的false?

[英]flex 4 list no selectable false?

is there any way to either set a flex 4 list component to selectable "false" or disable/hide its selectioncolor? 有什么办法可以将Flex 4列表组件设置为可选的“ false”,或者禁用/隐藏其selectioncolor? I've tried to change it designview, but it doesn't allow me change it that way. 我试图更改它的设计视图,但是不允许我那样更改它。 I've also tried tweaking it via the list component or the scroller/viewport control via as3, but I really can't seem to fin a way. 我也尝试通过list组件或通过as3的scroller / viewport控件对其进行调整,但是我似乎真的找不到办法。

If you have a list that doesn't have selection, you can quickly change it into DataGroup . 如果您有没有选择的列表,则可以快速将其更改为DataGroup Sometimes I even prefer using DataGroup instead of the List and if I need to manage a selection I add the selection state to the items in the data provider , thus each item would know whether it is selected. 有时,我什至宁愿使用DataGroup而不是List并且如果我需要管理选择,我会将选择状态添加到数据提供程序中的项目,因此每个项目都会知道它是否被选中。 This solution allows me to perform filtering, sorting, reordering on the list and still keep the selected state of the items. 此解决方案使我可以在列表上执行过滤,排序,重新排序,并且仍保持项目的选定状态。

try to put this on 试穿这个

ItemRenderer property
autoDrawBackground="false"

If you are making a mobile app and using IconItemRender (instead of ItemRenderer) there is no autoDrawBackground property. 如果要制作移动应用程序并使用IconItemRender(而不是ItemRenderer),则没有autoDrawBackground属性。 I did manage to find a solution and posted it here: Flex/FlashBuilder :: Spark List / IconItemRenderer:: Disable Selection Highlight / No Selection / Remove Selection 我确实找到了一个解决方案,并将其发布在这里: Flex / FlashBuilder :: Spark List / IconItemRenderer ::禁用选择高亮显示/无选择/删除选择

You could use an item renderer for the List, and set the selection color in the item renderer. 您可以为列表使用项目渲染器,并在项目渲染器中设置选择颜色。 Here are some examples of this: 以下是一些示例:

Styling both foreground and background selection color in a Flex list/datagrid 在Flex列表/数据网格中设置前景色和背景色的样式

您可能会发现这篇文章及其中的链接对于构建支持无法选择的项目的列表很有用: http : //flexponential.com/2009/12/20/disable-selection-on-some-items-in-a-spark-列表/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM