Hi all:
I have a custom component derived from VBox with a specific styleName.
When used in a Repeater, or stand-alone, the styles are perfect.
However, when I use the custom component in a List by setting the
itemRenderer property of the List component, the fonts are all wrong and
the text in Button labels are getting truncated.
During debugging, I found the Flex 3 List component causes item
renderers to inherit styles! It actually sets the styleName to the
instance variable of the List component!
// in mx.controls.List.as:
override public function createItemRenderer...
{
...
var renderer:IListItemRenderer;
...
renderer = factory.newInstance();
renderer.styleName = this;
...
return renderer;
}
We have a CSS Type selector for List and if I comment it out of the css
file, the problem goes away, but we have lots of other List instances in
our code base and I don't want to change them all to use CSS Class
selectors in order to work around this issue.
I've overridden the styleName setter in the renderer and explicitly set
it to my own style class selector and it doesn't work. My buttons in the
renderer even specifically set a styleName, and I'm able to override the
font issue in a brute force way, but the text continues to get
truncated, as though there is some measurement that is wrong, and I have
no idea which style to override to fix the truncation.
Q. Is there a simple way to prevent my item renderer from inheriting any
styles from the parent List component?
Thanks!
Erik