Android: Image width inside a webview -


i have simple webview inside image

i want set width attribute of image tag "90%" if size image > of device width

my displaymetrics says screen dimesions 720x1220 , correct.

displaymetrics{density=2.0, width=720, height=1220, scaleddensity=2.0, xdpi=320.0, ydpi=320.0} 

now image 600x300 code skip image when rendered runtime image big , go outside screen dimensions (so webview shows horizontal bar).

seems the webview (vewport??) works in dpi , not pixel, need test if image > 300 px resize image

there way know dimension of viewport in pixel ?

your html being zoomed webview. try this.

<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width" /> 

http://developer.android.com/guide/webapps/targeting.html#viewportdensity


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -