Jorodan Posted May 1, 2010 Share Posted May 1, 2010 Salut les jeunes, Je définis presque toutes mes interfaces en dip dans les XML. Mais quand je passe au code, je fais setHeight par exemple en pixel. Comment le faire en dip ? Link to comment Share on other sites More sharing options...
naholyr Posted May 1, 2010 Share Posted May 1, 2010 Ah tiens, je croyais que px et dip c'était pareil x] Ils en parlent ici : http://developer.motorola.com/docstools/library/The_Widget_Pack_Part_3_Swipe/ final float scale = getResources().getDisplayMetrics().density; scaledDistance = (int) ( DISTANCE_DIP * scale + 0.5f ); Link to comment Share on other sites More sharing options...
Jorodan Posted May 1, 2010 Author Share Posted May 1, 2010 Ok thanks! Et non px et dip pas pareil du tout! Le dip c'est le gros kiiiiiiiiiiff xD Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.