Quantcast
Channel: cocos2d-x - Cocos Forums
Viewing all articles
Browse latest Browse all 2748

TableView's inconsistent behaviour

$
0
0

@nedumaran wrote:

I am using TableView in two different areas in my app. The behaviour is strangely different while I think the code is similar. The desired behaviour is as in the video below. When I pull down it snaps back to the top. When I pull up, the cells are truncated at the top and it snaps back. The cells do not go pass the top. The code for this follows:

pagesTableView = TableView::create(this, Size(panelWidth, contentHeight));
pagesTableView->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT);
pagesTableView->setPosition(Vec2(xp,yp));
pagesTableView->setVerticalFillOrder(TableView::VerticalFillOrder::TOP_DOWN);
pagesTableView->setDelegate(this);

The next table view does not clip off the top. The cells go pass the top position, and do not snap back.

itemsTableView = TableView::create(this, Size(contentWidth, contentHeight));
itemsTableView->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT);
itemsTableView->setPosition(Vec2(xLeft, yBottom));
itemsTableView->setVerticalFillOrder(TableView::VerticalFillOrder::TOP_DOWN);
itemsTableView->setDelegate(this);

I am not sure what I’m missing. Perhaps there is some undetermined default that I am not setting.

Any help appreciated. Thank you.

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 2748

Trending Articles