软件按钮高度 [英] software buttons height

查看:142
本文介绍了软件按钮高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能(在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)


    在Nexus
  • 7

  • on nexus 7

画像:56dp结果
...

portrait: 56dp
...

景观:48dp结果
...

landscape: 48dp
...

这篇关于软件按钮高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆