本文介绍了什么是屏幕方向和-rotation在Android上有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是屏幕方向和-rotation在Android上有什么区别?这些术语通常可互换使用,似乎在网络上。

What's the difference between Screen Orientation and -Rotation on Android? The terms are often used interchangeably on the web it seems.

据上的德precation 讨论Display.getOrientation()的getRotation()的概念经常被误解/混淆。不进一步说明但是提供

According to a discussion on the deprecation of Display.getOrientation() for getRotation() the concepts are often misunderstood/confused. No further explanation is provided however.

我怀疑它理解方向和旋转的Andr​​oid设备上的复杂性,即使在充满异国情调的设备可以正确显示的应用程序很重要。

I suspect it's important to understand the intricacies of Orientation and Rotation on Android devices to correctly display an App even on exotic devices.

推荐答案

在你给小姐戴安娜Hackborn明确说明的联系;

At the link you gave Miss Dianne Hackborn clearly stated;

getOrientation()从未返回方向,它返回旋转所以它被重命名为getRotation()这是的的减少混乱其实你感到困惑 - 。你以为它返回方向,当它没有。

"getOrientation() has never returned orientation, it returns rotation. So it is being renamed to getRotation(). This is much less confusing. In fact you were confused -- you thought it returned orientation, when it does not."

要描述更加深刻;

  • Orientation: is concept for defining landscape, portrait, ...
  • Rotation: Returns the rotation of the screen from its "natural" orientation. The natural orientation is important here, because it is landscape on tablets and portrait on smaller devices.

这篇关于什么是屏幕方向和-rotation在Android上有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 07:31