我想知道当我们旋转设备时,它大约需要多长时间才能改变方向。在我的应用程序中,当我旋转手机设备时,旋转屏幕大约需要 1 到 2 秒。现在我的问题是,它是正常跨度还是延迟跨度。这样我就可以相应地进行处理。
提前致谢。
最佳答案
通过一些代码研究,看起来旋转 View 至少需要 200 毫秒。这种延迟是为了确保设备方向的改变是有意的。
来自 WindowOrientationListener.java 的代码 fragment 供引用:
// The number of milliseconds for which the device posture must be stable
// before we perform an orientation change. If the device appears to be rotating
// (being picked up, put down) then we keep waiting until it settles.
private static final int SETTLE_TIME_MIN_MS = 200;
关于android - 方向更改默认时间延迟...?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6937746/