bilgo
bilgo

Reputation: 137

Android WebView - Resize after orientation without reload the page

I have a webview with android:configChanges="keyboard|keyboardHidden|orientation" on the AndroidManifest.xml file because i don't want to reload the page when i'm changing the orienatation.

There are some pages when i'm changing from portrait to landscape and then from lanscape to portrait the page takes only half of the webview.

How can i fix it? I don't want to reload the page again. There is any way to resize the content without reload the page?

Upvotes: 2

Views: 3174

Answers (3)

PankajAndroid
PankajAndroid

Reputation: 2707

you just need to add

android:configChanges="orientation|screenSize"    
android:windowSoftInputMode="adjustResize"

and yet if you cannot get solution then there is something wrong in you code becuse you can chek my application it's working fine in my app https://play.google.com/store/apps/details?id=com.accusol.zipbooks&hl=en

Upvotes: 2

Hoang Nguyen Huu
Hoang Nguyen Huu

Reputation: 1252

I stuck in same problem, but at last found out the reason is related with "viewport" tag in the html file, not code. Try add this:
<meta name="viewport" content="user-scalable=yes, width=device-width, initial-scale=1.0"/>
in the html file and see whether the problem still exists.
Gluck.

Upvotes: 0

Arun C
Arun C

Reputation: 9035

Use screenSize also

android:configChanges="keyboard|keyboardHidden|orientation|screenSize"

Upvotes: -1

Related Questions