1.CBA:Command Button Area 命令按钮区域
1.动态改变cba的显示文字
可以在Vew::DoActivateL()中或在Container::ConstructL( )中
#include <eikbtgpc.h>
CEikButtonGroupContainer *cba = CEikButtonGroupContainer::Current();
//cba->MakeCommandVisible(EAknSoftkeyExit,EFalse);
cba->SetCommandL (EAknSoftkeyOptions , _L("my option"));
cba->SetCommandL (EAknSoftkeyExit , _L("my exit"));
//cba->DrawNow();
静态设置要在rss中配置
RESOURCE AVKON_VIEW r_option_back_view
{
cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
menubar = r_weaforecast_base_menu;//对应MENU_BAR资源,否则点击左键可能会空指针异常
toolbar = 0;
}
把r_option_back_view传给view的BaseConstructL(iResourceId);
2.CEikMenuPaneItem::SData中iFlags值要初始设置为0才显示这个菜单项。