krokodilcapa
I have a strange problem with ListView, it displays its items on top of each other. Am I doing something wrong, or its a bug?
Here is the code:
[code] window->SetSize(600, 200);
window->SetAlignment(HA_CENTER, VA_BOTTOM);
window->SetPosition(0, -50);
window->SetOpacity(0.5f);
window->SetStyleAuto();
listview = window->CreateChild<ListView>();
listview->SetSize(500, 100);
listview->SetAlignment(HA_CENTER, VA_BOTTOM);
listview->SetStyleAuto();
ResourceCache* cache = GetSubsystem<ResourceCache>();
XMLFile* style = cache->GetResource<XMLFile>("UI/DefaultStyle.xml");
for (int i = 0; i < 4; ++i)
{
Text* text = new Text(context_);
text->SetDefaultStyle(style);
text->SetStyleAuto();
text->SetText("TEXT" + i);
text->SetColor(Color::BLACK);
listview->AddItem(text);
}[/code]
Here is a picture: http://imgur.com/wRw1fbz
Edit:
Okay, its works now, I just forgot to set the default UI style!