• <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久久亚洲综合精品网站| 狠狠色噜噜色狠狠狠综合久久| 亚洲精品无码久久一线| 久久久噜噜噜久久熟女AA片| 东京热TOKYO综合久久精品| 国产高潮久久免费观看| 久久婷婷色综合一区二区| 久久香蕉超碰97国产精品| 热RE99久久精品国产66热| 国产欧美久久一区二区| 欧美伊人久久大香线蕉综合| 久久成人影院精品777| 久久精品视频一| 成人精品一区二区久久| 久久精品人人做人人爽电影蜜月 | 精品综合久久久久久88小说| 综合久久一区二区三区 | 久久免费美女视频| 久久热这里只有精品在线观看| 伊人久久精品线影院| 久久久av波多野一区二区| 2021最新久久久视精品爱| 国内精品久久久久影院网站| 久久99精品国产99久久6男男| 亚洲国产精品无码成人片久久| 久久久久人妻一区精品| 色综合久久久久网| 亚洲国产精品久久久久婷婷软件| 无码任你躁久久久久久老妇App| 2021国产成人精品久久| segui久久国产精品| 94久久国产乱子伦精品免费| 亚洲国产成人久久精品影视| 久久久久久九九99精品| 精品蜜臀久久久久99网站| 久久亚洲私人国产精品| 久久精品国产亚洲av麻豆小说| 久久综合88熟人妻| 久久香蕉一级毛片| 久久国产精品二国产精品| 日韩电影久久久被窝网|