My item renderer is an image, and the highlight for the selected item is under the image so you cannot see the highlight, is there a way to make the highlight “over” the image?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is exactly the point at which I realized how complicated certain simple-seeming things in Flex can really be. 🙂
There are various ways of handling a problem like this one depending on the effect you’re after, but the way I’ve always done it is first by overriding certain functions of the TileList, then by using custom itemRenderers. (I’ve never been able to figure out how to have the List’s graphics object of draw on top of the rendered content, though — someone else might be able to shed some light on that.)
For example, I’ll usually create a new class that extends TileList, then override the methods responsible for drawing the highlight and selection indicators to get a bit more control over the way those functions draw the indicators (or sometimes I’ll just comment out their contents altogether, such that nothing gets drawn):
But as you say, since the graphics object always seems to draw behind the content of the list item, I’ll usually opt to use an item renderer to draw something (e.g., a translucent box) on top of the image associated with my data item:
I’m sure there are other approaches, but this one works pretty well for me, and I usually find other benefits to subclassing the stock Flex controls as well.
Hope it helps!