M
M
MODifikaTOR2017-03-16 10:31:46
Java
MODifikaTOR, 2017-03-16 10:31:46

How to make webview full screen size?

I set my WebView width and height to match_parent, I launch the application and see that the content of the site is wider than the screen. In this case, everything is displayed correctly in chrome. What to add to the code of my WebView so that the content is displayed correctly?

private WebView browser;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_browser);

        browser = (WebView) findViewById(R.id.browser_window);
        browser.getSettings().setJavaScriptEnabled(true);
        browser.loadUrl("https://rassol.by/");
    }

<WebView
        android:id="@+id/browser_window"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="0dp"
        tools:layout_editor_absoluteX="8dp"
        tools:layout_editor_absoluteY="8dp" />

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Zemlyakov, 2017-03-17
@redtom

I suggest trying to disable javascript support. What will happen? (yes, I understand that this is not a solution to the problem, but something tells me that I need to move in this direction)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question