I've got the hard-coded layout, consisting of buttons, and need to enlarge some of them. I found Button
's method setWidth(int value)
, accepting width in pixels, but I need to set value in dp. So, how can I set dp value in program code?
views:
56answers:
1
+1
A:
TypedValue lets you do unit conversions -- for example: http://developer.android.com/reference/android/util/TypedValue.html#applyDimension(int, float, android.util.DisplayMetrics)
hackbod
2010-08-01 16:23:57
Thank you a lot!
furikuretsu
2010-08-02 07:38:26