symbian 界面绘制

设备, 软件 版本:

S60 3rd Edition

S60 3rd Edition, FP1

 

详细描述:

缺省情况下,程序是根据手机屏幕的当前方向开始启动的。如果要强制程序以横屏或竖屏的模式启动,那我们在CAknAppUi::ConstructL()方法中调用BaseConstructL()时就要传递相应的flag值:

void CMyAppUi::ConstructL()
{
BaseConstructL( EAknEnableSkin | EAppOrientationLandscape );    // start in landscape mode
...
}


如果要在程序运行期间改变方向,则需要调用:

void CAknAppUiBase::SetOrientationL( TAppUiOrientation aOrientation );


这里的参数为EAppUiOrientationLandscape和EAppUiOrientationPortrait,注意这种情况下的调用就不要再向BaseConstructL()中传递相同的参数了。

注意

  • 横屏(landscape),前者是横幅,一般多用在风景照,所以叫"landscape"。
  • 竖屏(portrait),后者是直幅,一般多用在肖像上,所以叫"portrait"。

 

 symbian 界面绘制收藏
 
全屏
构造container时,将AppUi()->ApplicationRect()做为参数aRect传递进去。
然后在container构造函数中调用SetRect(aRect);这样即可全屏显示
 
隐藏状态栏
      CEikStatusPane* statusPane = StatusPane();    
            statusPane->MakeVisible( EFalse );   
 
旋转屏幕
2.8,3.0 SDK支持屏幕旋转,程序里面可以捕获该消息,然而使UI自定义的改变位置
继承的函数为:Container::HandleResourceChange,原先的SizeChange这个函数不会响应
 
在该函数内不要使用AppUi->ClientRect函数来获取工作区范围,数据会有偏差(这个问题郁闷了好久),可以使用
TRect rect;
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,rect );
来获取RECT 
 
 
全屏到正常
User "SetRect" inside your container. Pass in the original client area rect parameter back to the CCoeControl.

You may use the following code:

1) Before calling "SetExtentToWholeScreen", save the rect:

iRect = Rect();

Gets the control's extent

2) call "SetExtentToWholeScreen"

3) Switch back:

SetRect( iRect );
 
 
获取当前旋转状态
http://wiki.forum.nokia.com/index.php/How_to_get_the_Current_Orientation
#include <aknappui.h>
 
CCoeEnv* env = CCoeEnv::Static();
if( env )
    {
    CAknAppUiBase* appUiBase = REINTERPRET_CAST( CAknAppUiBase*, env->AppUi() );
    if( appUiBase )
        {
        /*
        * Possible values for TAppUiOrientation are :
        * EAppUiOrientationUnspecified,
        * EAppUiOrientationPortrait,
        * EAppUiOrientationLandscape,
        * EAppUiOrientationAutomatic
        **/
        CAknAppUiBase::TAppUiOrientation orientation = appUiBase->Orientation();
        }
    }


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/houxp/archive/2008/11/03/3211959.aspx

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值