为什么这样还是不能显示动态添加的列表图标?
列表类型是SingleLarge,代码如下:
//iList原先是创建好的空列表
CTextListBoxModel* model = iList->Model();
model->SetOwnershipType (ELbmOwnsItemArray);
CDesCArray* savedArray = STATIC_CAST(CDesCArray*, model->ItemTextArray());
savedArray->Reset();
iController.SetCategoryList(*savedArray); //设置了saveArray的值;
CArrayPtr<CGulIcon>* iconList = new (ELeave) CAknIconArray(2);
CleanupStack::PushL(iconList);
iconList->AppendL( iEikonEnv->CreateIconL(
KIconFile,
EMbmMpthemeListicon1,
EMbmMpthemeListicon1_mask) );
iconList->AppendL( iEikonEnv->CreateIconL(
KIconFile,
EMbmMpthemeListicon2,
EMbmMpthemeListicon2_mask) );
iList->ItemDrawer()->ColumnData()->SetIconArray( iconList );
CleanupStack::Pop();
iList->HandleItemAdditionL();
[解决办法]
确定iController.SetCategoryList(*savedArray); 没问题吗