在RSS文件中对话框的DLG_LINE写法:
DLG_LINE { type = EAknCtLastControlId; //注意这里 id = ESettingList; control = AVKON_SETTING_ITEM_LIST // 注意这里 { flags = EAknSettingItemNumberedStyle; title = SERVICE_SETTING_TITLE; items = { AVKON_SETTING_ITEM { //这里没有变化 }, AVKON_SETTING_ITEM { ....... } }; }; }
最后在重写对话框类的CreateCustomControlL(),如果结合从CAknDialog派生的对话框使用可以不加代码就可以实现滚动条 SEikControlInfo CServiceSettingForm::CreateCustomControlL(TInt /*aControlType*/) { //iSettingList 是对话框类的数据成员,CPop3SettingsList是列表类, //iSettings是保存列表值的成员 iSettingList = new (ELeave) CPop3SettingsList(iSettings);
SEikControlInfo controlInfo; controlInfo.iFlags = EEikControlHasEars; controlInfo.iTrailerTextId = 0; controlInfo.iControl = iSettingList; static_cast<CPop3SettingsList*>(controlInfo.iControl)->SetContainerWindowL(*this);
return controlInfo; } |