Flex/FlashBuilder :: Spark List / IconItemRenderer:: Disable Selection Highlight / No Selection / Remove Selection

情到浓时终转凉″ 提交于 2019-12-12 00:05:22

问题


I had trouble removing the selected and down state colors for a spark list using IconItemRender. If you are making a mobile app and using IconItemRender (instead of ItemRenderer) there is no autoDrawBackground property.

I figured I'd drop it in here after figuring it out thanks to this page: http://www.sajeevkumar.com/2012/01/08/flex-4-6-list-mobile-iconitemrenderer-background-image/


回答1:


You can do the following to muck around with the down and selected colors. For more control over items in a list using IconItemRender look at the LabelItemRenderer class and the drawBackground function.

override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void {

            var bgColor:uint = 0xffffff;

            graphics.clear();

            graphics.beginFill(bgColor,1);
            graphics.lineStyle();
            graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
            graphics.endFill();

            // Draw the separator for the item renderer
            super.drawBorder(unscaledWidth, unscaledHeight);

            opaqueBackground = bgColor;
        }


来源:https://stackoverflow.com/questions/11442498/flex-flashbuilder-spark-list-iconitemrenderer-disable-selection-highlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!