I can't make my WebView wrap the displayed content. The problem is that the WebView width is all the screen, while the height is about 300px. How can I make it wrap content and be like the file suppose to be?
Here is my current layout XML:
<WebView
android:id="@+id/animation_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
Webview is built to render HTML pages which doesn't have size. so there is no way for it to determine something that doesn't exist and re-size according to it the same way say an ImageView resizes when the src image has changed.
Your best choice is to set the size of the webview to a fixed value maybe with weight and the user will have to scroll inside it when the page is bigger than the webview itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With