Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set my webview boundaries?
    primarykey
    data
    text
    <p>I have a webview app, that uses js code files from assets. The issue I am having is that I have the game files in js that it takes up half the web browser. Now when I use the same as a webview in my app, it seems to be scrollable and half the view gets cut off from the screen which is scrollable. Is there a way I can restrict the boundaries of the webview and also force my webview to show the entire content of the webpage I am displaying? The following is my webview code:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; </code></pre> <p>Do I need to add this in a layout? If so, how do I go about it? Here is my java code:</p> <pre><code>import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import android.webkit.WebView; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main); WebView webview = (WebView)findViewById(R.id.webview); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl("file:///android_asset/index.htm"); } } </code></pre> <p>Any changes required to the source files?</p> <p>Thanks! Justin</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload