各个设备上的蜂窝状状态栏(位于底部)的高度是否相同?

发布于 2025-01-01 07:41:50 字数 174 浏览 3 评论 0原文

我试图弄清楚状态栏(具有“主页”和“后退”按钮的状态栏)在不同设备上是否一致,即它占据了多少垂直像素,如果是的话,这个数字是多少,如果不是的话,该怎么办我这样做是为了动态获取高度,以便我可以根据剩余的屏幕空间采取相应的行动。

我看到其他几个问题有点回避这个主题,但没有一个真正给出明确的答案。

TIA

I'm trying to figure out if the Status bar (the one that has the Home and Back buttons) is consistant across devices, in terms of how many vertical pixels it occupies, and if so what that number is, and if not what do I do to get the height dynamically, so that I can act accordingly with the remaining screen real estate.

I see a couple of other questions that sort of skirt this topic, but none that actually give a definitive answer.

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

始于初秋 2025-01-08 07:41:50

我试图弄清楚状态栏(具有“主页”和“后退”按钮的状态栏)在不同设备上是否一致

甚至在同一设备上也不一致。

举个例子:如果您通过 HDMI 将 WXGA 设备插入电视并将其横向放置,则系统栏会变大一点,因此系统栏外部的空间将恰好为 720p(1280x720,系统栏高 80 像素) 。

如果是的话,这个数字是多少

它是一个非负整数。其他一切都没有记录,因此可能会发生变化。

如何动态获取高度

你不知道。你不用关心系统吧。你关心的是你可以绘制的空间以及它有多大。无论有零、一、二还是二十个系统栏都没有关系。

我原以为会有一种更少 hack(y) 的方法。

Christopher 建议的是“减少 hack(y) 方法”。您尝试做的事情明显更加hacky,因为它对可能侵入您的绘图空间的内容做出了假设。

I'm trying to figure out if the Status bar (the one that has the Home and Back buttons) is consistant across devices

It is not even consistent on the same device.

One example: if you plug a WXGA device into a television via HDMI and hold it in landscape, the system bar will grow a bit, so that the space outside the system bar will be exactly 720p (1280x720, with an 80px high system bar).

if so what that number is

It is a non-negative integer. Everything else is undocumented and, therefore, subject to change.

what do I do to get the height dynamically

You don't. You do not care about the system bar. You care about the space you can draw in and how big that is. Whether there is zero, one, two, or twenty system bars does not matter.

I was assuming there'd be a less hack(y) approach.

What Christopher suggested is the "less hack(y) approach". What you were trying to do is significantly more hacky, as it makes assumptions about what might be intruding upon your drawing space.

秋叶绚丽 2025-01-08 07:41:50

因为它使用密度无关像素,所以是的。如果您拿出一把尺子进行测量,您会发现每个设备上的高度都是相同的。

Since it uses Density Independent Pixels, yes. If you whipped out a ruler and measured it, it'd be the same height on every device.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文