android - Programmatically set height on LayoutParams as density-independent pixels -
is there way set height/width of layoutparams density-independent pixels (dp)? looks height/width, when set programmatically, in pixels , not dp.
you need convert dip value pixels:
int height = (int) typedvalue.applydimension(typedvalue.complex_unit_dip, <height>, getresources().getdisplaymetrics());
for me trick.
Comments
Post a Comment