problem with background when changing view.
| Sun, 2008-04-13 15:03 | |
|
Hi, void CMyViewContainer::Draw( const TRect& aRect ) const I know Clear(); is causing white background.but if I remove this,listbox items from my previous view also get displayed in my current view.I need default theme background over which my text should be displayed.Do I need to deactivate the previous view before switching.Is there any API which can set the theme's default background.Please help,I am not good at UI.Thanx in advance. |
|






Forum posts: 146
Hi dattanand,
Check have you enable screen Background in AppUI.
and use this draw function
void CMyViewContainer::Draw( const TRect& aRect ) const{
CWindowGc& gc = SystemGc();
gc.Clear();
AknsDrawUtils::Background(AknsUtils::SkinInstance(),AknsDrawUtils::ControlContext(this), this, gc, aRect);
}
Hope this code will be helpful for you....
Thanks & Regards,
Md.Khalid Ahmad
Forum posts: 5
what do u mean by enabling backgroung in AppUI.I am confused,Is it related to BaseConstructL()?
Forum posts: 5
I was able to display background.but the background was not drawn on the whole window,some upper portion ans lower portion of the screen(where softkey labels are displayed) was undrawn.I found a quick fix for that.
void CMy ViewContainer::ConstructL( const TRect& aRect )
{
// Creates window.
CreateWindowL();
//SetExtentToWholeScreen();
TInt aWidth = 240;
TInt aHeight = 300;
SetExtent(TPoint(0,0),TSize::TSize(aWidth,aHeight));
.....................
.....................
}
But I have hardcoded the screen size.Is there any API which gives the size of the screen?
Forum posts: 146
Hi
AknsDrawUtils::Background(AknsUtils::SkinInstance(),AknsDrawUtils::ControlContext(this), this, gc, aRect);try this
TRect appRect = iappui->ApplicationRect()AknsDrawUtils::Background(AknsUtils::SkinInstance(),AknsDrawUtils::ControlContext(this), this, gc, appRect);
Hope you don't need to use hard coded value.
and my first thing was related to BaseConstructL(); you understood right.
Thanks & Regards,
Md.Khalid Ahmad