• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 2, 文章 - 73, 評論 - 60, 引用 - 0
            數據加載中……

            [S60]在程序的導航條中插入文本或圖片

            • 開發伙伴平臺:

            S60 3rd Edition


            • 詳細描述

            S60應用程序在前臺時,可以設置導航條顯示自定義圖標或文本。


            首先,我們要獲得一個狀態欄的引用。然后可以從中獲得導航欄的引用。應用程序可以使用CAknNavigationDecorator類生成一個基于文本的Navi decorator對象。最后這個對象需要添加到導航欄中以便開始顯示:

            //------------------------------------------------------------------------------
             
            CAknNavigationControlContainer* iNaviPane = 0;
             
            CAknNavigationDecorator* iNaviDecorator = 0;
             
            //Get the reference of the status pane
             
            CEikStatusPane *statusPane = iEikonEnv->AppUiFactory()->StatusPane();
             
            if ( statusPane )
             
            {
             
            //Get the reference of the navi pane
             
            iNaviPane=static_cast<CAknNavigationControlContainer*>(statusPane->ControlL(
             
            TUid::Uid(EEikStatusPaneUidNavi)) );
             
            //Create a Navi decorator object
             
            iNaviDecorator= iNaviPane->CreateEditorIndicatorContainerL();
             
            //Get the reference of the indicator container inside the NaviDecorator
             
            CAknIndicatorContainer* indiContainer =
             
            static_cast<CAknIndicatorContainer*>(iNaviDecorator->DecoratedControl());
             
            if ( indiContainer && CEikStatusPaneBase::Current() )
             
            {
             
            TBuf<32> msgSize;
             
            msgSize.Append(_L("Test")); // Text to be displayed
             
             
            indiContainer->SetIndicatorValueL(
             
            TUid::Uid( EAknNaviPaneEditorIndicatorMessageLength ), msgSize );
             
             
            indiContainer->SetIndicatorState(
             
            TUid::Uid( EAknNaviPaneEditorIndicatorMessageLength ),
             
            EAknIndicatorStateOn);
             
            }
             
             
             
            //Push the object onto the navi pane.
             
            iNaviPane->PushL( *iNaviDecorator );
             
            }
             
            //------------------------------------------------------------------------------


            下面的這個示例代碼,演示了如何在導航欄中顯示一個圖標:

            //------------------------------------------------------------------------------
             
            CFbsBitmap* bitmap = NULL;
             
            CFbsBitmap* mask = NULL;
             
            CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
             
            CAknNavigationControlContainer* naviPane =
             
            (CAknNavigationControlContainer*)statusPane->ControlL(
             
            TUid::Uid(EEikStatusPaneUidNavi));
             
            // Create an icon
             
            AknIconUtils::CreateIconLC (bitmap, mask, KIconFile,
             
            EMbmCarsvgCircle, EMbmCarsvgCircle_mask); //KIconFile is the .mif file
             
             
            TSize size(30,30);
             
            AknIconUtils::SetSize(bitmap, size); // Sets the size of the extracted image
             
            //Create a Navi Decorator encapsulation for the image.
             
            CAknNavigationDecorator* naviDecorator =
             
            naviPane->CreateNavigationImageL(bitmap, mask);
             
            //Push the image onto the navi pane.
             
            naviPane->PushL(*naviDecorator);
             
            //------------------------------------------------------------------------------


            需要的頭文件及庫文件有:

            #include <aknnavi.h>               // for CAknNavigationControlContainer
             
            #include <eikspane.h>              // for CEikStatusPane
             
            #include <aknnavide.h>             // for CAknNavigationDecorator
             
            #include <akniconutils.h>          // for AknIconUtils
             
            #include <aknindicatorcontainer.h> // for CAknIndicatorContainer
             
            LIBRARY     aknicon.lib
             
            LIBRARY     fbscli.lib
             
            LIBRARY     avkon.lib


            注意:程序在前臺時這些導航欄上的文字和圖標才得以顯現,但手機待機時卻不會處理。

            posted on 2008-04-10 11:04 郭天文 閱讀(738) 評論(0)  編輯 收藏 引用 所屬分類: S60

            成人国内精品久久久久一区| 嫩草影院久久99| 模特私拍国产精品久久| 国产香蕉久久精品综合网| 新狼窝色AV性久久久久久| 久久精品国产一区二区三区日韩| 狠狠精品干练久久久无码中文字幕| 久久婷婷五月综合色99啪ak| 色综合久久久久无码专区| 99久久精品国产一区二区三区| 一级做a爰片久久毛片毛片| 国内精品久久久久伊人av| 一本色道久久88综合日韩精品 | 久久久高清免费视频| 精品久久久久久久无码| 久久精品国产黑森林| 久久久精品人妻一区二区三区蜜桃| 国产日韩久久免费影院| 91精品国产综合久久久久久| 亚洲精品无码久久久久AV麻豆| 伊人久久大香线焦综合四虎| 亚洲国产精品无码久久久秋霞2 | 久久91亚洲人成电影网站| 久久精品中文字幕大胸| 94久久国产乱子伦精品免费| 久久亚洲精品中文字幕| 亚洲伊人久久精品影院| 久久受www免费人成_看片中文| 久久亚洲电影| 无夜精品久久久久久| 亚洲国产精品综合久久网络| 久久无码一区二区三区少妇| 久久精品国产精品亚洲艾草网美妙| 久久99久久99小草精品免视看| 久久久久亚洲AV无码永不| 亚洲va久久久噜噜噜久久| 国内精品综合久久久40p| 亚洲精品无码专区久久久| 亚洲乱码中文字幕久久孕妇黑人| 亚洲精品国产美女久久久| 久久国产精品77777|