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.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

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 );
	}
  }
}

 

Retired
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
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/
Highlighted
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10: Skin List

I tried CellRenderer has the base class as well and it still did nothing.