ListView container margins

Hello,

I’m trying to create a ranking ListView, I’m having problems with the container margins.

How can I set a top and bottom margin to the ListView to show the itens inside de container border not over it?

Thank you

2 Likes

I have the same problem…

	auto params = cocos2d::ui::RelativeLayoutParameter::create();
	params->setMargin(cocos2d::ui::Margin(0, 0, 0, 40));
	listView->getInnerContainer()->setLayoutParameter(params);

Setting margin in inner container doesn’t work…

Cocos2dx UI component is really terrible written. Sorry i Love cocos but this part is terrible!

I tried this, but with a Margin(40, 0, 0, 0) and even a Margin(100, 100, 100, 100) to see if I added any padding to the inside of my Listview and it didn’t. I didn’t have this problem when the child was a ui::Text but now that it’s a ui::TextBMFont it seems to not be avoidable.