http://blog.youkuaiyun.com/wzq9706/article/details/9105915
+(void) setTableOffsetToIndex:(SWTableView*) table itemCounts:(int) itemCounts index:(int) index cellSize:(CGSize) cellSize {
float offsetX = 0;
float offsetY = 0;
if (table.direction == SWScrollViewDirectionVertical) {
if (table.verticalFillOrder == SWTableViewFillTopDown) {
offsetY = -cellSize.height * (itemCounts - index - 1);
} else {
offsetY = -cellSize.height * index;
}
} else {
if (table.verticalFillOrder == SWTableViewFillTopDown) {
offsetX = -cellSize.width * (itemCounts - index - 1);
} else {
offsetX = -cellSize.width * index;
}
}
[table setContentOffset:ccp(offsetX, offsetY)];
}