dp = Math.ceil(pixels / density)
or
dp = (int) (pixels / density + 0.5)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
DisplayMetrics can return density , I think you can do some calculation...
在 2012年6月22日星期五UTC+8下午11时11分26秒,Raghav Sood写道:
>
> Hi,
>
> Does android have any method that returns the display width in dp?
> DisplayMetrics only seems to return the scale factor and exact pixels as
> far as I could tel
2 matches
Mail list logo