android4.0默认界面旋转180

来源:互联网 发布:linux more命令退出 编辑:程序博客网 时间:2024/06/17 01:36

不巧新拿的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;
原创粉丝点击