在一個container中有多個複合控件的情況下,實現切換橫豎屏幕的時候,發現在SizeChanged()裏定義的操作執行了,但是container裏的控件卻沒有被重繪。
後發現,複合控件的container裏必須要實現兩個方法
TInt CmydlgAppView::CountComponentControls() const
{
return 1; // return nbr of controls inside this container
}
CCoeControl* CmydlgAppView::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
case 0:
if ( iColListBox )
{
return iColListBox;
}
default:
return NULL;
}
}
有了這兩個方法以後,重繪的時候container 才能找到裏面複合控件,進行重繪。