Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Developer
jtegen
Posts: 6,149
Registered: ‎10-27-2010
My Carrier: AT&T

BB10: Skin List

I've been trying to get the BB10 List to skin with a different renderer, but it is not doing anything.  Using same approach as is done on the PlayBook.  What is the best way to create a renderer for the new List component?

 

this.list.cellRenderer = renderer.NavigateRenderer;

 Renderer:

package renderer
{
	import qnx.fuse.ui.display.Image;
	import qnx.fuse.ui.listClasses.AlternatingCellRenderer;
	//import qnx.fuse.ui.listClasses.CellRenderer;
	
	public class NavigateRenderer extends AlternatingCellRenderer
	{
		private var image :Image = new Image();
		
		[Embed(source='assets/right_nav.png')]                  private var nav_icon            : Class;
		
		//////////////////////////////////////////////////////////
	public function NavigateRenderer()
	{
		super();
		this.image.setImage( new nav_icon() );
	}
		
	override protected function onAdded():void
	{
		this.addChild( this.image );
	}
		
	override protected function onRemoved():void
	{
		this.removeChild( this.image );
	}
		
	//////////////////////////////////////////////////////
	override protected function drawLabel(unscaledWidth:Number, unscaledHeight:Number):void
	{
		super.drawLabel( unscaledWidth, unscaledHeight );
			
		this.image.setPosition( unscaledWidth - this.image.width, ( unscaledHeight - this.image.height ) / 2 );
	}
  }
}

 

Please use plain text.
BlackBerry Development Advisor
dmalik
Posts: 339
Registered: ‎02-22-2012
My Carrier: Bell

Re: BB10: Skin List

Hi,

 

I'll look into this a little more for you but from what I've heard AlternatingCellRenderer is no longer the default renderer for the List. It is simply the CellRenderer now.

 

Dustin

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Please use plain text.
Developer
jtegen
Posts: 6,149
Registered: ‎10-27-2010
My Carrier: AT&T

Re: BB10: Skin List

I tried CellRenderer has the base class as well and it still did nothing.
Please use plain text.