
现在,我得到与此图像相同的读数:
我不明白的是:如果我旋转手机时坐标系没有改变(总是面向用户的屏幕),应始终在Y轴上施加重力.如果我将手机放在屏幕不再面向用户的位置,例如放在桌子上,重力应该应用在Z轴上,它应该只改变轴.
我的理解有什么问题?
谢谢!吉列尔莫.
解决方法 当设备的屏幕方向改变时,交换轴.根据你引用的文章:However,the AndroID sensor APIs define the sensor coordinate space to be relative to the top and sIDe of the device — not the short and long sIDes. When the system reorIEnts the screen in response to holding the phone sIDeways,the sensor coordinate system no longer lines up with the screen’s coordinate system,and you get unexpected rotations in the display of your app.
要根据需要访问未交换的值,请在值[]中使用索引3,4和5,否则同一篇文章中提到的一些建议可以很好地工作!
总结以上是内存溢出为你收集整理的Android中的传感器坐标系不会改变,是吗?全部内容,希望文章能够帮你解决Android中的传感器坐标系不会改变,是吗?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)