Friday, August 27, 2010

[android-developers] getContentHeight pixel density

i'm trying to use getContentHeight to compute how much scrollable
content i have remaining in a WebView. when i run my app on devices
w/ different screen dimensions getContentHeight appears to return the
same value while the getHeight() on the container of the WebView
returns different values (larger for higher density screen, smaller
for lower density screen).

question: what units does getContentHeight return? i would expect
this value is actual pixels, and thus would change for the same
content on different devices with different density screens.

thoughts?

--
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
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

1 comment:

  1. I have seen this issue too,
    If you take getContentHeight * getResources() .getDisplayMetrics().density, I think you will get the right amount of pixels.
    //Johan

    ReplyDelete