• <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
            數(shù)據(jù)加載中……

            [S60]在程序的導(dǎo)航條中插入文本或圖片

            • 開發(fā)伙伴平臺:

            S60 3rd Edition


            • 詳細(xì)描述

            S60應(yīng)用程序在前臺時,可以設(shè)置導(dǎo)航條顯示自定義圖標(biāo)或文本。


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

            //------------------------------------------------------------------------------
             
            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 );
             
            }
             
            //------------------------------------------------------------------------------


            下面的這個示例代碼,演示了如何在導(dǎo)航欄中顯示一個圖標(biāo):

            //------------------------------------------------------------------------------
             
            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


            注意:程序在前臺時這些導(dǎo)航欄上的文字和圖標(biāo)才得以顯現(xiàn),但手機(jī)待機(jī)時卻不會處理。

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

            国产精品久久国产精麻豆99网站| 精品久久久一二三区| 国产91久久精品一区二区| 久久精品国产亚洲欧美| 国产成人香蕉久久久久| 中文成人久久久久影院免费观看| 一级做a爰片久久毛片免费陪 | 国产激情久久久久影院| 久久免费看黄a级毛片| 久久久久久免费一区二区三区| 久久综合视频网站| 国产日产久久高清欧美一区| 色综合久久夜色精品国产| 91麻豆精品国产91久久久久久| 99久久精品免费看国产一区二区三区| 久久精品国产半推半就| 一级女性全黄久久生活片免费 | 精品久久久久久久久午夜福利| 久久久久香蕉视频| 国产精品青草久久久久婷婷| 久久这里只精品99re66| 大蕉久久伊人中文字幕| 国产欧美久久一区二区| 久久er99热精品一区二区| 伊人久久大香线蕉无码麻豆| 国产成人香蕉久久久久| 一级做a爱片久久毛片| 久久精品国产亚洲av麻豆色欲| 久久亚洲精品国产精品婷婷| 久久人人爽人人爽人人片AV麻豆 | 久久黄视频| 久久九九久精品国产免费直播| 国产国产成人精品久久| 91精品国产高清91久久久久久| 色综合久久久久综合体桃花网| yy6080久久| 久久天天躁狠狠躁夜夜躁2O2O| 亚洲精品乱码久久久久久中文字幕 | 老男人久久青草av高清| 人妻无码精品久久亚瑟影视| 欧美日韩中文字幕久久久不卡|