android4.0默认界面旋转180

来源:互联网 发布:绘画教程软件 编辑:程序博客网 时间:2024/06/05 21:58

转自http://blog.csdn.net/yicao821/article/details/7374890

不巧新拿的android4.0默认启动画面和正常显示旋转了180度,即为倒立的。原来是屏输出为倒的,查找得知可以做旋转:

步骤:

一:先把这个加上 然后加上属性ro.sf.hwrotation = 180

二:在init.rc脚本中添加如下内容:      setprop ro.sf.hwrotation180

  1. 修改frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp文件,在voidGraphicPlane::setDisplayHardware(DisplayHardware*hw)函数中添加如下内容:
      case 180:
           displayOrientation =ISurfaceComposer::eOrientation180;
           break;
三:frameworks\base\services\java\com\android\server\wm\ScreenRotationAnimation.java
// Screenshot does NOT include rotation!
        mSnapshotRotation = (SystemProperties.getInt("ro.sf.hwrotation",0)==180)?2:0;
        //mSnapshotRotation = 0;


0 0