扩展QNX TileList组件以创建液体布局
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了扩展QNX TileList组件以创建液体布局相关的知识,希望对你有一定的参考价值。
public class LiquidTileList extends TileList { /** * if true, when changing the size of the tiles * scrolls the list so the first tile from the previous * state is still visible */ public var keepVisibleItem:Boolean; public function LiquidTileList() { super(); setSkin(PictureCellRenderer); } /** * Overriding the draw method to inject * our method of calculating the number of * tiles that fit the screen * This method is called every time the width/height * is changed */ override protected function draw():void { var i:int; if (keepVisibleItem && firstVisibleItem) i = firstVisibleItem.index; scrollIndexVisible(0, 0); calculateColumns(); super.draw(); if (keepVisibleItem && i) scrollIndexVisible(i, 0); } /** * Calculates the number of tiles that fit * the width */ private function calculateColumns():void { var columnNumber:int = Math.floor( (width - (cellPadding * columnCount -1) ) / columnWidth); if (columnNumber != columnCount) columnCount = columnNumber; } }
以上是关于扩展QNX TileList组件以创建液体布局的主要内容,如果未能解决你的问题,请参考以下文章
按单词包装 UILabel 并以编程方式扩展 UITableViewCell 高度