看你的framebuffer的驱动中,有没有相关的代码,可能触摸屏的驱动也要修改。
解决方案 »
- 请问如何查xml布局文件的文档?
- 求助IOException (Permission denied)
- 怎样让后台运行的程序在安卓桌面上弹出对话框?
- Android中如何导入本地数据库
- 放大了linearlayout ,如何让linearlayout的宽高也放大啊
- 怎么从Garrely中获取图片,在新的Activity中打开
- 手机RAM,Flash ROM、内存概念的困惑,看你是否真的明白
- 哪里有android的2.6.32内核 下载??
- 两个ViewPager,里面的一个不起作用,怎么办?
- alertdialog
- 如何定制Android的一个1280*800的skin?
- SQLite和SQL同步问题?
还好楼主不需要去读底层的一些3轴加速度之类的,可以在里面直接设置吧。具体也没怎么看过,不过应该是在这个地方了。研究研究
这个出始改为 private static int sRotation = Surface.ROTATION_90;么试试?
弱弱的抱怨下。。待在这里天天改bug心里纠结 想换
这里有个说横竖屏切换的但他那个第三步不知道怎么改不知道那代码说的啥,高深,或者是我不懂c的缘故
status_t SurfaceFlinger::readyToRun()中
//const uint32_t w = hw.getWidth();
//const uint32_t h = hw.getHeight();
//swap w&h for portrait display in landscape panel. jeff.
const uint32_t h = hw.getWidth();
const uint32_t w = hw.getHeight();
这个是因为机器是横屏,却要竖的显示,交换了h,w的值,可以理解为view显示的范围,面积设定好了,下面就是旋转显示的view了...
下班了。改天再看那部分源码
哥哥啊,我可是一直在等着你。 少打了个字,sorry
还是看他的代码吧
graphicPlane 缓冲区输出管理(楼主可以看这篇文章 ttp://blog.csdn.net/maxleng/archive/2010/06/14/5671271.aspx)
-------------------------------------------------------------
GraphicPlane::GraphicPlane()
: mHw(0)
{
/*
重置mOrientationTransform一些参数为90度的情况,因为以前默认的是0 度初始的情况,所以要修改里面的实现Transform.cpp中的reset函数,可以模仿orientationToTransfrom为90度的情况,所以要修改为
void Transform::reset() {
mTransform.reset();
mType = 0;
set(0,-1,1,0);
const DisplayHardware& hw(displayHardware());
const float w = hw.getWidth();
float x = w;
set(x,0);
}
*/
mOrientationTransform.reset();
mOrientation = ISurfaceComposer::eOrientation90; //设置初始 90度
mGlobalTransform = mOrientationTransform * mTransform; //这个是目标转换90度的情况
}
因为初始话的一些东西被修改了,因此也要修改其中的
status_t GraphicPlane::setOrientation(int orientation)
{
//对orientation等于90 的判断,初始值已经被修改为90了
if (orientation == ISurfaceComposer::eOrientation90) {
// make sure the default orientation is optimal
mOrientationTransform.reset();
mOrientation = orientation;
//mGlobalTransform = mTransform;
mGlobalTransform = mOrientationTransform * mTransform//目标变换应该是这个了
return NO_ERROR;
}
}
按他的代码来了,整体框架不熟悉,但是感觉要修改初始就转变90度,无非就是修改初始化屏幕的时候,把它当成已经转了90度时的参数
http://blog.csdn.net/knock/archive/2010/03/01/5335767.aspx
试了没有?