TableView's inconsistent behaviour

TableView's inconsistent behaviour

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

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->setPosition(Vec2(xLeft, yBottom));

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

Any help appreciated. Thank you.

Answering my own question … after a couple of hours of poking into the code, I found out that the top position of the TableView is higher than my desired position. The background being transparent made this less obvious to figure out. My second TableView behaves exactly as my first now. Problem solved! :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.