I'm trying to create a scrollbar for a settings list. It never shows. If I look at pFrame->iV->iBar (after CreateScrollBarFrameL() is called), it is null. Also, iExternalScrollBarAttached is 0. I have other code for other lists that inits the scrollbar the same way and it doesn't fail. (iBar is not null after CreateScrollBarFrameL() is called, iExternalScrollBarAttached is 1)

Here is the code called inside my view container class:

m_pList = new (ELeave) mySettingsList();
m_pList->ConstructFromResource(myResId); // adds 6 items
CEikFormattedCellListBox* pListBox = m_pList->ListBox();
CEikScrollBarFrame* pFrame = pListBox->ScrollBarFrame();
pFrame->SetScrollBarVisibility(CEikScrollBarFrame:EOff, CEikScrollBarFrame:EOn);