软件按钮高度 [英] software buttons height
问题描述
我怎么能(在Galaxy Nexus的或摩托罗拉RAZR HD等)计算的软件按钮高度?
How I can calculate height of software buttons (like in galaxy nexus or razr motorola hd) ?
就个人而言,我想这 DisplayMetrics.heightPixels
属性是所有的屏幕高度,无需软件按钮的高度和状态栏的高度。
Personally, I suppose that DisplayMetrics.heightPixels
attribute is height of all screen without software buttons height and with height of status bar.
因此,软件按钮高度 = 规格高度 - DisplayMetrics.heightPixels
Hence, software buttons height = specification height - DisplayMetrics.heightPixels.
为例针对Nexus 7的:
Exemple for nexus 7:
75(软按钮高度)1280(规格高) - 第1205(DisplayMetrics.heightPixels)
林权?请确认。
推荐答案
我的假设是正确的。
概括的问题,证明了这一点,在这里手工测量什么,我已经在电话和平板电脑自做截图:
to generalize question and prove it, here manual measurement what I have done on telephone and tablet from screenshots :
- 三星GALAXY Nexus
- samsung galaxy nexus
画像:48 DP结果
1280年至1184年96 == == PX 48dp xhdpi
portrait: 48 dp
1280 - 1184 == 96 px == 48dp xhdpi
景观:42 DP结果
1280年至1196年84 == == PX 42dp xhdpi
landscape: 42 dp
1280 - 1196 == 84 px == 42dp xhdpi
(注意!:在景观,这是不是高度,但软件按钮的宽度放置在屏幕的右侧)
( attention!: in landscape, this is not height but width of software button placed on right side of screen)
- 7
在Nexus
- on nexus 7
画像:56dp结果
...
portrait: 56dp
...
景观:48dp结果
...
landscape: 48dp
...
这篇关于软件按钮高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!