android - text and sp / dp, it just does not work nicely -
i testing app on nexus 5 (full hd screen) , htc 1 x (720p).
using sp android developer, gives me result not want! text on nexus 5 bigger on htc 1 x, taking account screen bigger in size.
when use 'dp' instead of 'sp', more alike...the result want...
but want use sp, way should it.
so created values-sw380dp directory , put there different value. but, nexus 5 not use these values! used code:
displaymetrics displaymetrics = getresources().getdisplaymetrics(); float dpheight = displaymetrics.heightpixels / displaymetrics.density; float dpwidth = displaymetrics.widthpixels / displaymetrics.density;
surprisingly: both phones, dpwidth == 360! have no way nicely 720p , 1080p screen ?
does have idea or solution?
i tempted use dp...
Comments
Post a Comment