Android How to create interface element that occupies the whole screen

1

Let's imagine that I have a newly created empty application of type "Navigation Drawer Activity" then in the design I add a webview and then I extend it on the whole screen and the problem is the following one in which occupies the full screen

Is there any way my webView can fill the whole screen?

    
asked by Diego 15.02.2017 в 02:25
source

1 answer

1

The way a view occupies the whole screen until today is not possible, what I recommend is Hide the status bar

  if (Build.VERSION.SDK_INT < 16) {
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
  }else{
        View decorView = getWindow().getDecorView();
        // Hide the status bar.
        int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
        decorView.setSystemUiVisibility(uiOptions);
        // Remember that you should never show the action bar if the
        // status bar is hidden, so hide that too if necessary.
        ActionBar actionBar = getActionBar();
       actionBar.hide();

 }

and configure the properties in your view:

 android:layout_width="match_parent"
 android:layout_height="match_parent"

This way you would see the view, "full screen":

    
answered by 15.02.2017 / 04:58
source