简体   繁体   中英

Is the Honeycomb Status bar (at the bottom) the same height across devices?

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM