• <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 郭天文 閱讀(747) 評論(0)  編輯 收藏 引用 所屬分類: S60

            99久久精品免费国产大片| 久久综合九色综合网站| 一本久久a久久精品vr综合| 精品久久久久久无码免费| 亚洲精品高清国产一久久| 国产激情久久久久影院老熟女免费 | 久久精品亚洲乱码伦伦中文| AA级片免费看视频久久| 99久久国产综合精品网成人影院| 亚洲成人精品久久| 99久久精品免费看国产| 亚洲国产高清精品线久久 | 精品久久久一二三区| 狠狠色丁香久久婷婷综合蜜芽五月 | 久久精品成人免费观看97| 精品国产综合区久久久久久| 国产AⅤ精品一区二区三区久久| 久久精品国产只有精品66| 国产精品久久新婚兰兰| 久久婷婷成人综合色综合| 久久精品9988| 亚洲午夜精品久久久久久浪潮| 一本色道久久99一综合| 狠狠色噜噜狠狠狠狠狠色综合久久| 国产精品午夜久久| 四虎国产精品成人免费久久| 久久久久成人精品无码中文字幕| 91精品日韩人妻无码久久不卡 | 久久99精品久久久大学生| 久久99国产综合精品| 亚洲国产成人久久一区WWW| 久久亚洲AV成人无码电影| 久久久久久久综合综合狠狠| 亚洲AV无码成人网站久久精品大| 国产成人久久精品麻豆一区 | 综合久久一区二区三区 | 久久青青草原亚洲av无码| 久久天天躁狠狠躁夜夜avapp | 日韩精品久久无码中文字幕| 久久精品无码专区免费| 久久精品成人免费看|