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?
I’ve got the hard-coded layout, consisting of Button s, and need to enlarge some
Share
TypedValuelets you do unit conversions – applyDimension (int unit, float value, DisplayMetrics metrics)