gpt4 book ai didi

android - 方向更改默认时间延迟...?

转载 作者:太空狗 更新时间:2023-10-29 14:31:02 24 4
gpt4 key购买 nike

我想知道当我们旋转设备时,它大约需要多长时间才能改变方向。在我的应用程序中,当我旋转手机设备时,旋转屏幕大约需要 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com