给 Listbox 的 item 添加背景(未验证)
void CProfileListBox::ConstructL(const TRect& aRect,
const CCoeControl* aParent, MEikCommandObserver* aCommandObserver)
{
...
TFileName iMFileName;
iMFileName.Copy(KMifFileName);
CompleteWithAppPath(iMFileName);
setBackground();
iBgContext = CAknsBasicBackgroundControlContext::NewL(aSkinItem, aRect,
ETrue);
ActivateL();
...
}
void CProfileListBox::setBackground()
{
TFileName iMFileName;
iMFileName.Copy(KMifFileName);
CompleteWithAppPath(iMFileName);
aSkinItem.iMinor = 0xE2139689;
aSkinItem.iMajor = 1;
CAknsItemDef* mainBgItemDef = AknsUtils::CreateBitmapItemDefL(
aSkinItem, iMFileName,
EMbmContextcallhandLandscape_profile);
AknsUtils::SkinInstance()->SetLocalItemDefL(mainBgItemDef);
}
const CCoeControl* aParent, MEikCommandObserver* aCommandObserver)
{
...
TFileName iMFileName;
iMFileName.Copy(KMifFileName);
CompleteWithAppPath(iMFileName);
setBackground();
iBgContext = CAknsBasicBackgroundControlContext::NewL(aSkinItem, aRect,
ETrue);
ActivateL();
...
}
void CProfileListBox::setBackground()
{
TFileName iMFileName;
iMFileName.Copy(KMifFileName);
CompleteWithAppPath(iMFileName);
aSkinItem.iMinor = 0xE2139689;
aSkinItem.iMajor = 1;
CAknsItemDef* mainBgItemDef = AknsUtils::CreateBitmapItemDefL(
aSkinItem, iMFileName,
EMbmContextcallhandLandscape_profile);
AknsUtils::SkinInstance()->SetLocalItemDefL(mainBgItemDef);
}