• <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久久久香蕉| 亚洲国产精品无码成人片久久| 99久久婷婷国产综合亚洲| 久久最近最新中文字幕大全 | 久久国产色AV免费看| 7国产欧美日韩综合天堂中文久久久久 | 久久久噜噜噜久久| 亚洲精品美女久久久久99| 亚洲国产成人久久精品动漫| 精品伊人久久久| AA级片免费看视频久久| 性高湖久久久久久久久| 久久久久国产一区二区| 国产成人精品免费久久久久| 色天使久久综合网天天| 亚洲嫩草影院久久精品| 欧美亚洲色综久久精品国产| 四虎国产精品免费久久| 色综合合久久天天综合绕视看| 欧美精品乱码99久久蜜桃| 久久综合狠狠综合久久激情 | 久久精品蜜芽亚洲国产AV| 国产美女亚洲精品久久久综合| 国内精品久久久久久久涩爱| 久久久中文字幕| 久久精品一本到99热免费| 亚洲精品无码久久千人斩| 久久精品国产久精国产一老狼| 日本亚洲色大成网站WWW久久| 精品久久久久中文字幕一区| 色综合久久天天综合| 国产成人无码精品久久久久免费 | 伊人色综合九久久天天蜜桃| 老司机国内精品久久久久| 久久国产精品久久精品国产| 成人妇女免费播放久久久| 国产成人精品久久二区二区| 久久久青草青青亚洲国产免观| 久久久91精品国产一区二区三区| 国产精品久久久久…| 大香网伊人久久综合网2020|