关闭

px与dip之间的转换

296人阅读 评论(0) 收藏 举报
官网 http://developer.android.com/reference/android/util/TypedValue.html

public static float applyDimension (int unit, float value, DisplayMetrics metrics)

Added in API level 1

Converts an unpacked complex data value holding a dimension to its final floating point value. The two parameters unit and value are as in TYPE_DIMENSION.

Parameters
unit The unit to convert from.
value The value to apply the unit to.
metrics Current display metrics to use in the conversion -- supplies display density and scaling information.
Returns
  • The complex floating point value multiplied by the appropriate metrics depending on its unit.

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:25170次
    • 积分:213
    • 等级:
    • 排名:千里之外
    • 原创:95篇
    • 转载:1篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档