| Package | qnx.ui.listClasses |
| Class | public class TileList |
| Inheritance | TileList List UIComponent flash.display.MovieClip |
TileList class can be used to display a list of cells in a grid format.
When the list is set to scroll vertically, the columnCount property is used to layout the grid.
You can use the rowHeight and columnWidth height properties to set the dimensions of each cell.
You can use the cellPadding property to set the padding between each cell.
The following image shows a TileList instance.
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | allowDeselect : Boolean
Determines if a selected cell in the list can be deselected when pressed. | List | |
| cellPadding : int
Gets or sets the amount of padding between cells (in pixels) in the grid. | TileList | ||
| columnCount : int
Gets or sets the number of columns in the grid. | TileList | ||
![]() | columnWidth : int
Gets or sets the width of each column in the list. | List | |
![]() | containment : String
Gets or sets a property that determines how a component is contained within a parent container. | UIComponent | |
![]() | dataProvider : IDataProvider
Gets or sets the DataProvider instance for the list. | List | |
![]() | enableShadows : Boolean
Sets or gets whether the scroll shadows should be shown. | List | |
![]() | firstVisibleItem : ICellRenderer [read-only]
Returns the first visible item in the view port area as defined by the width and height
| List | |
![]() | footerView : DisplayObject
Gets or sets the footer view. | List | |
![]() | lastVisibleItem : ICellRenderer [read-only]
Returns the last visible item in the view port area as defined by the width and height
| List | |
| rowCount : int
Gets or sets the number of rows in the list. | TileList | ||
![]() | rowHeight : int
Gets or sets the height of each row in the list. | List | |
![]() | scrollable : Boolean
Gets or sets a value that determines whether a list can be scrolled. | List | |
![]() | scrollBarAlpha : Number
Gets or sets the opacity value for the scroll bar on the list. | List | |
![]() | scrollBarColor : Number
Gets or sets the color of the scroll bar. | List | |
![]() | scrollBarOffset : int
Gets or sets the x or y postion of the scrollbar, in pixels. | List | |
![]() | scrollDirection : String
Gets and sets the scroll direction of the list. | List | |
![]() | selectedIndex : int
Gets or sets the index of the currently selected item in a single-selection list. | List | |
![]() | selectedIndices : Array
Gets or sets the selected cells at the specified indices in a multi-selectable list. | List | |
![]() | selectedItem : Object
Gets or sets the currently selected item in a single-selectable list. | List | |
![]() | selectedItems : Array
Gets or sets the group of selected items (selectedItems) in a multi-selectable list. | List | |
![]() | selectionMode : int
Gets or sets a value that determines whether or not selection mode is enabled. | List | |
![]() | size : Number
Gets or sets the size for this component (as a percentage of the
container's size, or in pixels). | UIComponent | |
![]() | sizeMode : String
Gets or sets the size mode for this component. | UIComponent | |
![]() | sizeUnit : String
Gets or sets the unit of measure for the size property. | UIComponent | |
| Method | Defined By | ||
|---|---|---|---|
TileList()
Creates a new TileList instance. | TileList | ||
![]() | addItem(item:Object):void
Appends an item to the end of the list. | List | |
![]() | addItemAt(item:Object, index:int):void
Adds an item to the list at the specified index. | List | |
![]() | addItemsAt(items:Array, index:int):void
Adds an array item at the specified index. | List | |
![]() | destroy():void
Call this method when you want to have your object collected by the garbage collector. | UIComponent | |
![]() | drawNow():void
Calls the draw() method. | UIComponent | |
![]() | getIsCellVisibleAtIndex(index:int):Boolean
Returns a Boolean indicating whether or not a cell at a given index is visible in the virtual area. | List | |
![]() | getItemAt(index:int):Object
Returns the item in the DataProvider at the specified index. | List | |
![]() | invalidate(property:String, invalidateNow:Boolean = false):void
Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first. | UIComponent | |
![]() | removeAll():void
Removes all the items from the list. | List | |
![]() | removeItem(item:Object):void
Removes a given item from the list. | List | |
![]() | removeItemAt(index:int):void
Removes an item from list at the specified index. | List | |
![]() | replaceItem(item:Object, oldObject:Object):void
Replaces an item, given the new item object and the old item. | List | |
![]() | replaceItemAt(item:Object, index:int):void
Replaces the item in the list at the specified index with a new item. | List | |
![]() | scrollIndexVisible(index:int, seconds:Number = 1):void
Scrolls a given item into view, given an index and an animation duration (in seconds). | List | |
![]() | scrollToIndex(index:int, seconds:Number = 1):void
Animates the cell at the specified index into view. | List | |
![]() | setPosition(x:Number, y:Number):void
Sets the x and y position of the component. | UIComponent | |
![]() | setSize(w:Number, h:Number):void
Sets the width and height of the component. | UIComponent | |
![]() | setSkin(skin:Object):void
Sets the cell renderer to use to populate the list. | List | |
![]() | updateItem(value:Object, oldObject:Object):void
Updates an item in the list, given the new item and the item to update. | List | |
![]() | updateItemAt(item:Object, index:int):void
Updates the item in the list at the specified index, given the new item. | List | |
![]() | updateItemsAt(items:Array, index:int):void
Updates the items starting at the specified index with new items. | List | |
| cellPadding | property |
cellPadding:intGets or sets the amount of padding between cells (in pixels) in the grid.
The default value is 10.
public function get cellPadding():int public function set cellPadding(value:int):void| columnCount | property |
columnCount:intGets or sets the number of columns in the grid.
The default value is 1.
public function get columnCount():int public function set columnCount(value:int):void| rowCount | property |
rowCount:intGets or sets the number of rows in the list.
public function get rowCount():int public function set rowCount(value:int):void| TileList | () | Constructor |
public function TileList()
Creates a new TileList instance.
The following example creates a TileList instance. The TileList uses a background in order to contrast against the
stage.
package
{
import flash.display.Sprite;
import qnx.ui.data.DataProvider;
import qnx.ui.listClasses.TileList;
[SWF(height="600", width="1024",
frameRate="30", backgroundColor="#FFFFFF")]
public class TileListSample extends Sprite
{
public function TileListSample()
{
initializeUI();
}
private function initializeUI():void
{
var arrMonth:Array=[];
arrMonth.push({label: "January"});
arrMonth.push({label: "February"});
arrMonth.push({label: "March"});
arrMonth.push({label: "April"});
arrMonth.push({label: "May"});
arrMonth.push({label: "June"});
arrMonth.push({label: "July"});
arrMonth.push({label: "August"});
arrMonth.push({label: "September"});
arrMonth.push({label: "October"});
arrMonth.push({label: "November"});
arrMonth.push({label: "December"});
var bg:Sprite = new Sprite();
bg.graphics.lineStyle(2,0xCCCCCC);
bg.graphics.beginFill(0x333333,1);
bg.graphics.drawRect(0,0,340,320);
bg.graphics.endFill();
bg.x = 90;
bg.y = 190;
this.addChild(bg);
var myTileList:TileList = new TileList();
myTileList.setPosition(100, 200);
myTileList.width = 330;
myTileList.height = 300;
myTileList.columnCount = 3;
myTileList.cellPadding = 5;
myTileList.dataProvider = new DataProvider(arrMonth);
this.addChild(myTileList);
}
}
}