Symbian关于自定义皮肤的一点总结
2010-07-21 04:31:00 来源:WEB开发网刚刚做了一个更换系统皮肤的小东西,记录下来
mmp需要加入的lib
LIBRARY aknskins.lib aknskinsrv.lib aknswallpaperutils.lib
头文件
#include
#include
#include
下面代码是更换了状态栏和CBA的皮肤,更多的地方自己查ID
CEikAppUi* appUi = CEikonEnv::Static()->EikAppUi();
CEikApplication* app = appUi->Application();
desSkinImagesFile = (app->BitmapStoreName());
desSkinImagesFile.SetLength(desSkinImagesFile.LocateReverse('\') + 1);
desSkinImagesFile.Append(_L("skintest_aif.mif"));
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
CAknsItemData* item = skin->GetCachedItemData(KAknsIIDQsnBgAreaStatus );
if (item == NULL)
{
item = skin->CreateUncachedItemDataL(KAknsIIDQsnBgAreaStatus );
}
CAknsItemDef* def = AknsUtils::CreateBitmapItemDefL(
KAknsIIDQsnBgAreaStatus , desSkinImagesFile, EMbmSkintest_aifBiaoti);
skin->SetLocalItemDefL(def);
def = AknsUtils::CreateBitmapItemDefL(KAknsIIDQsnBgScreen ,desSkinImagesFile,EMbmSkintest_aifBiaoti);
skin->SetLocalItemDefL(def);
def = AknsUtils::CreateBitmapItemDefL(KAknsIIDQsnBgAreaControl,desSkinImagesFile,EMbmSkintest_aifCaidan);
skin->SetLocalItemDefL(def);
下面代码更换系统字体颜色
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
CAknsItemData* itemData = skin->GetCachedItemData(KAknsIIDQsnTextColors, EAknsITColorTable);
CAknsColorTableItemData* colorItemData =
static_cast
TAknsColorTableEntry textColors[50];
for (TInt i = 0; i < 50; i++)
{