Android Toolbar and Webview












1














I've got a Webview and a Toolbar. Without the Toolbar, the Webview is completely scollable, but when I add the Toolbar the the Webview doesn't scroll anymore. I've tried NestedScrollView but it just doesn't work. Here's the layout of my activity:



<android.support.design.widget.CoordinatorLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="100">
<ImageButton
android:id="@+id/homeButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="20"
android:contentDescription="@string/home"
app:srcCompat="@drawable/ic_home" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="60"
android:gravity="center"
android:text="@string/app_name"
android:textSize="24sp"
android:textStyle="bold"
app:fontFamily="Sans Serif" />
<ImageButton
android:id="@+id/menuButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="20"
android:contentDescription="@string/menu"
app:srcCompat="@drawable/ic_menu_black_24dp" />
</LinearLayout>
</android.support.v7.widget.Toolbar>

<RelativeLayout
android:id="@+id/relative"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MailActivity">
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</RelativeLayout>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>


The Java code for the Toolbar simply creates the menu and the home button, while the webview simply loads an url (javascript is enabled).
Thanks a lot for your help!










share|improve this question



























    1














    I've got a Webview and a Toolbar. Without the Toolbar, the Webview is completely scollable, but when I add the Toolbar the the Webview doesn't scroll anymore. I've tried NestedScrollView but it just doesn't work. Here's the layout of my activity:



    <android.support.design.widget.CoordinatorLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize">
    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:weightSum="100">
    <ImageButton
    android:id="@+id/homeButton"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="20"
    android:contentDescription="@string/home"
    app:srcCompat="@drawable/ic_home" />
    <TextView
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="60"
    android:gravity="center"
    android:text="@string/app_name"
    android:textSize="24sp"
    android:textStyle="bold"
    app:fontFamily="Sans Serif" />
    <ImageButton
    android:id="@+id/menuButton"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="20"
    android:contentDescription="@string/menu"
    app:srcCompat="@drawable/ic_menu_black_24dp" />
    </LinearLayout>
    </android.support.v7.widget.Toolbar>

    <RelativeLayout
    android:id="@+id/relative"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MailActivity">
    <WebView
    android:id="@+id/webview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
    </RelativeLayout>
    </android.support.design.widget.AppBarLayout>
    </android.support.design.widget.CoordinatorLayout>


    The Java code for the Toolbar simply creates the menu and the home button, while the webview simply loads an url (javascript is enabled).
    Thanks a lot for your help!










    share|improve this question

























      1












      1








      1







      I've got a Webview and a Toolbar. Without the Toolbar, the Webview is completely scollable, but when I add the Toolbar the the Webview doesn't scroll anymore. I've tried NestedScrollView but it just doesn't work. Here's the layout of my activity:



      <android.support.design.widget.CoordinatorLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent">

      <android.support.design.widget.AppBarLayout
      android:id="@+id/appbar"
      android:layout_width="match_parent"
      android:layout_height="match_parent">
      <android.support.v7.widget.Toolbar
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize">
      <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal"
      android:weightSum="100">
      <ImageButton
      android:id="@+id/homeButton"
      android:layout_width="0dp"
      android:layout_height="match_parent"
      android:layout_weight="20"
      android:contentDescription="@string/home"
      app:srcCompat="@drawable/ic_home" />
      <TextView
      android:layout_width="0dp"
      android:layout_height="match_parent"
      android:layout_weight="60"
      android:gravity="center"
      android:text="@string/app_name"
      android:textSize="24sp"
      android:textStyle="bold"
      app:fontFamily="Sans Serif" />
      <ImageButton
      android:id="@+id/menuButton"
      android:layout_width="0dp"
      android:layout_height="match_parent"
      android:layout_weight="20"
      android:contentDescription="@string/menu"
      app:srcCompat="@drawable/ic_menu_black_24dp" />
      </LinearLayout>
      </android.support.v7.widget.Toolbar>

      <RelativeLayout
      android:id="@+id/relative"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MailActivity">
      <WebView
      android:id="@+id/webview"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
      </RelativeLayout>
      </android.support.design.widget.AppBarLayout>
      </android.support.design.widget.CoordinatorLayout>


      The Java code for the Toolbar simply creates the menu and the home button, while the webview simply loads an url (javascript is enabled).
      Thanks a lot for your help!










      share|improve this question













      I've got a Webview and a Toolbar. Without the Toolbar, the Webview is completely scollable, but when I add the Toolbar the the Webview doesn't scroll anymore. I've tried NestedScrollView but it just doesn't work. Here's the layout of my activity:



      <android.support.design.widget.CoordinatorLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent">

      <android.support.design.widget.AppBarLayout
      android:id="@+id/appbar"
      android:layout_width="match_parent"
      android:layout_height="match_parent">
      <android.support.v7.widget.Toolbar
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize">
      <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal"
      android:weightSum="100">
      <ImageButton
      android:id="@+id/homeButton"
      android:layout_width="0dp"
      android:layout_height="match_parent"
      android:layout_weight="20"
      android:contentDescription="@string/home"
      app:srcCompat="@drawable/ic_home" />
      <TextView
      android:layout_width="0dp"
      android:layout_height="match_parent"
      android:layout_weight="60"
      android:gravity="center"
      android:text="@string/app_name"
      android:textSize="24sp"
      android:textStyle="bold"
      app:fontFamily="Sans Serif" />
      <ImageButton
      android:id="@+id/menuButton"
      android:layout_width="0dp"
      android:layout_height="match_parent"
      android:layout_weight="20"
      android:contentDescription="@string/menu"
      app:srcCompat="@drawable/ic_menu_black_24dp" />
      </LinearLayout>
      </android.support.v7.widget.Toolbar>

      <RelativeLayout
      android:id="@+id/relative"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MailActivity">
      <WebView
      android:id="@+id/webview"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
      </RelativeLayout>
      </android.support.design.widget.AppBarLayout>
      </android.support.design.widget.CoordinatorLayout>


      The Java code for the Toolbar simply creates the menu and the home button, while the webview simply loads an url (javascript is enabled).
      Thanks a lot for your help!







      android webview scrollview android-coordinatorlayout






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 '18 at 23:52









      Pasquale Scalise

      83




      83
























          3 Answers
          3






          active

          oldest

          votes


















          0














          <android.support.design.widget.CoordinatorLayout 
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent">

          <android.support.design.widget.AppBarLayout
          android:id="@+id/appbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content">

          <android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize">
          <LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="horizontal"
          android:weightSum="100">
          <ImageButton
          android:id="@+id/homeButton"
          android:layout_width="0dp"
          android:layout_height="match_parent"
          android:layout_weight="20"
          android:contentDescription="@string/home"
          app:srcCompat="@drawable/ic_home" />
          <TextView
          android:layout_width="0dp"
          android:layout_height="match_parent"
          android:layout_weight="60"
          android:gravity="center"
          android:text="@string/app_name"
          android:textSize="24sp"
          android:textStyle="bold"
          app:fontFamily="Sans Serif" />
          <ImageButton
          android:id="@+id/menuButton"
          android:layout_width="0dp"
          android:layout_height="match_parent"
          android:layout_weight="20"
          android:contentDescription="@string/menu"
          app:srcCompat="@drawable/ic_menu_black_24dp" />
          </LinearLayout>
          </android.support.v7.widget.Toolbar>

          </android.support.design.widget.AppBarLayout>

          <WebView
          android:id="@+id/webview"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_alignParentLeft="true"
          android:layout_alignParentStart="true"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

          </android.support.design.widget.CoordinatorLayout>





          share|improve this answer





























            0














            You have to move Relative layout outside of the Appbar.






            share|improve this answer





























              0














              <?xml version="1.0" encoding="utf-8"?>
              <LinearLayout
              xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              xmlns:tools="http://schemas.android.com/tools"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

              <android.support.design.widget.AppBarLayout
              android:id="@+id/appbar"
              android:layout_width="match_parent"
              android:layout_height="wrap_content">
              <android.support.v7.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize">
              <LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="horizontal"
              android:weightSum="100">
              <ImageButton
              android:id="@+id/homeButton"
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="20"
              android:contentDescription="@string/home"
              app:srcCompat="@drawable/ic_home" />
              <TextView
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="60"
              android:gravity="center"
              android:text="@string/app_name"
              android:textSize="24sp"
              android:textStyle="bold"
              app:fontFamily="Sans Serif" />
              <ImageButton
              android:id="@+id/menuButton"
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="20"
              android:contentDescription="@string/menu"
              app:srcCompat="@drawable/ic_menu_black_24dp" />
              </LinearLayout>
              </android.support.v7.widget.Toolbar>

              </android.support.design.widget.AppBarLayout>

              <WebView
              android:id="@+id/webview"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

              </LinearLayout>





              share|improve this answer





















                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53254426%2fandroid-toolbar-and-webview%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                0














                <android.support.design.widget.CoordinatorLayout 
                xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <android.support.design.widget.AppBarLayout
                android:id="@+id/appbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize">
                <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal"
                android:weightSum="100">
                <ImageButton
                android:id="@+id/homeButton"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="20"
                android:contentDescription="@string/home"
                app:srcCompat="@drawable/ic_home" />
                <TextView
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="60"
                android:gravity="center"
                android:text="@string/app_name"
                android:textSize="24sp"
                android:textStyle="bold"
                app:fontFamily="Sans Serif" />
                <ImageButton
                android:id="@+id/menuButton"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="20"
                android:contentDescription="@string/menu"
                app:srcCompat="@drawable/ic_menu_black_24dp" />
                </LinearLayout>
                </android.support.v7.widget.Toolbar>

                </android.support.design.widget.AppBarLayout>

                <WebView
                android:id="@+id/webview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

                </android.support.design.widget.CoordinatorLayout>





                share|improve this answer


























                  0














                  <android.support.design.widget.CoordinatorLayout 
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:app="http://schemas.android.com/apk/res-auto"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent">

                  <android.support.design.widget.AppBarLayout
                  android:id="@+id/appbar"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content">

                  <android.support.v7.widget.Toolbar
                  android:id="@+id/toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize">
                  <LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:orientation="horizontal"
                  android:weightSum="100">
                  <ImageButton
                  android:id="@+id/homeButton"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="20"
                  android:contentDescription="@string/home"
                  app:srcCompat="@drawable/ic_home" />
                  <TextView
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="60"
                  android:gravity="center"
                  android:text="@string/app_name"
                  android:textSize="24sp"
                  android:textStyle="bold"
                  app:fontFamily="Sans Serif" />
                  <ImageButton
                  android:id="@+id/menuButton"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="20"
                  android:contentDescription="@string/menu"
                  app:srcCompat="@drawable/ic_menu_black_24dp" />
                  </LinearLayout>
                  </android.support.v7.widget.Toolbar>

                  </android.support.design.widget.AppBarLayout>

                  <WebView
                  android:id="@+id/webview"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_alignParentLeft="true"
                  android:layout_alignParentStart="true"
                  app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

                  </android.support.design.widget.CoordinatorLayout>





                  share|improve this answer
























                    0












                    0








                    0






                    <android.support.design.widget.CoordinatorLayout 
                    xmlns:android="http://schemas.android.com/apk/res/android"
                    xmlns:app="http://schemas.android.com/apk/res-auto"
                    xmlns:tools="http://schemas.android.com/tools"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <android.support.design.widget.AppBarLayout
                    android:id="@+id/appbar"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <android.support.v7.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize">
                    <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal"
                    android:weightSum="100">
                    <ImageButton
                    android:id="@+id/homeButton"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="20"
                    android:contentDescription="@string/home"
                    app:srcCompat="@drawable/ic_home" />
                    <TextView
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="60"
                    android:gravity="center"
                    android:text="@string/app_name"
                    android:textSize="24sp"
                    android:textStyle="bold"
                    app:fontFamily="Sans Serif" />
                    <ImageButton
                    android:id="@+id/menuButton"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="20"
                    android:contentDescription="@string/menu"
                    app:srcCompat="@drawable/ic_menu_black_24dp" />
                    </LinearLayout>
                    </android.support.v7.widget.Toolbar>

                    </android.support.design.widget.AppBarLayout>

                    <WebView
                    android:id="@+id/webview"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

                    </android.support.design.widget.CoordinatorLayout>





                    share|improve this answer












                    <android.support.design.widget.CoordinatorLayout 
                    xmlns:android="http://schemas.android.com/apk/res/android"
                    xmlns:app="http://schemas.android.com/apk/res-auto"
                    xmlns:tools="http://schemas.android.com/tools"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <android.support.design.widget.AppBarLayout
                    android:id="@+id/appbar"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <android.support.v7.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize">
                    <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal"
                    android:weightSum="100">
                    <ImageButton
                    android:id="@+id/homeButton"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="20"
                    android:contentDescription="@string/home"
                    app:srcCompat="@drawable/ic_home" />
                    <TextView
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="60"
                    android:gravity="center"
                    android:text="@string/app_name"
                    android:textSize="24sp"
                    android:textStyle="bold"
                    app:fontFamily="Sans Serif" />
                    <ImageButton
                    android:id="@+id/menuButton"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="20"
                    android:contentDescription="@string/menu"
                    app:srcCompat="@drawable/ic_menu_black_24dp" />
                    </LinearLayout>
                    </android.support.v7.widget.Toolbar>

                    </android.support.design.widget.AppBarLayout>

                    <WebView
                    android:id="@+id/webview"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

                    </android.support.design.widget.CoordinatorLayout>






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 12 '18 at 4:30









                    saeedata

                    38616




                    38616

























                        0














                        You have to move Relative layout outside of the Appbar.






                        share|improve this answer


























                          0














                          You have to move Relative layout outside of the Appbar.






                          share|improve this answer
























                            0












                            0








                            0






                            You have to move Relative layout outside of the Appbar.






                            share|improve this answer












                            You have to move Relative layout outside of the Appbar.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 12 '18 at 3:58









                            honey_ramgarhia

                            1167




                            1167























                                0














                                <?xml version="1.0" encoding="utf-8"?>
                                <LinearLayout
                                xmlns:android="http://schemas.android.com/apk/res/android"
                                xmlns:app="http://schemas.android.com/apk/res-auto"
                                xmlns:tools="http://schemas.android.com/tools"
                                android:orientation="vertical"
                                android:layout_width="match_parent"
                                android:layout_height="match_parent">

                                <android.support.design.widget.AppBarLayout
                                android:id="@+id/appbar"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content">
                                <android.support.v7.widget.Toolbar
                                android:id="@+id/toolbar"
                                android:layout_width="match_parent"
                                android:layout_height="?attr/actionBarSize">
                                <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="match_parent"
                                android:orientation="horizontal"
                                android:weightSum="100">
                                <ImageButton
                                android:id="@+id/homeButton"
                                android:layout_width="0dp"
                                android:layout_height="match_parent"
                                android:layout_weight="20"
                                android:contentDescription="@string/home"
                                app:srcCompat="@drawable/ic_home" />
                                <TextView
                                android:layout_width="0dp"
                                android:layout_height="match_parent"
                                android:layout_weight="60"
                                android:gravity="center"
                                android:text="@string/app_name"
                                android:textSize="24sp"
                                android:textStyle="bold"
                                app:fontFamily="Sans Serif" />
                                <ImageButton
                                android:id="@+id/menuButton"
                                android:layout_width="0dp"
                                android:layout_height="match_parent"
                                android:layout_weight="20"
                                android:contentDescription="@string/menu"
                                app:srcCompat="@drawable/ic_menu_black_24dp" />
                                </LinearLayout>
                                </android.support.v7.widget.Toolbar>

                                </android.support.design.widget.AppBarLayout>

                                <WebView
                                android:id="@+id/webview"
                                android:layout_width="match_parent"
                                android:layout_height="match_parent"
                                app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

                                </LinearLayout>





                                share|improve this answer


























                                  0














                                  <?xml version="1.0" encoding="utf-8"?>
                                  <LinearLayout
                                  xmlns:android="http://schemas.android.com/apk/res/android"
                                  xmlns:app="http://schemas.android.com/apk/res-auto"
                                  xmlns:tools="http://schemas.android.com/tools"
                                  android:orientation="vertical"
                                  android:layout_width="match_parent"
                                  android:layout_height="match_parent">

                                  <android.support.design.widget.AppBarLayout
                                  android:id="@+id/appbar"
                                  android:layout_width="match_parent"
                                  android:layout_height="wrap_content">
                                  <android.support.v7.widget.Toolbar
                                  android:id="@+id/toolbar"
                                  android:layout_width="match_parent"
                                  android:layout_height="?attr/actionBarSize">
                                  <LinearLayout
                                  android:layout_width="match_parent"
                                  android:layout_height="match_parent"
                                  android:orientation="horizontal"
                                  android:weightSum="100">
                                  <ImageButton
                                  android:id="@+id/homeButton"
                                  android:layout_width="0dp"
                                  android:layout_height="match_parent"
                                  android:layout_weight="20"
                                  android:contentDescription="@string/home"
                                  app:srcCompat="@drawable/ic_home" />
                                  <TextView
                                  android:layout_width="0dp"
                                  android:layout_height="match_parent"
                                  android:layout_weight="60"
                                  android:gravity="center"
                                  android:text="@string/app_name"
                                  android:textSize="24sp"
                                  android:textStyle="bold"
                                  app:fontFamily="Sans Serif" />
                                  <ImageButton
                                  android:id="@+id/menuButton"
                                  android:layout_width="0dp"
                                  android:layout_height="match_parent"
                                  android:layout_weight="20"
                                  android:contentDescription="@string/menu"
                                  app:srcCompat="@drawable/ic_menu_black_24dp" />
                                  </LinearLayout>
                                  </android.support.v7.widget.Toolbar>

                                  </android.support.design.widget.AppBarLayout>

                                  <WebView
                                  android:id="@+id/webview"
                                  android:layout_width="match_parent"
                                  android:layout_height="match_parent"
                                  app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

                                  </LinearLayout>





                                  share|improve this answer
























                                    0












                                    0








                                    0






                                    <?xml version="1.0" encoding="utf-8"?>
                                    <LinearLayout
                                    xmlns:android="http://schemas.android.com/apk/res/android"
                                    xmlns:app="http://schemas.android.com/apk/res-auto"
                                    xmlns:tools="http://schemas.android.com/tools"
                                    android:orientation="vertical"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent">

                                    <android.support.design.widget.AppBarLayout
                                    android:id="@+id/appbar"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content">
                                    <android.support.v7.widget.Toolbar
                                    android:id="@+id/toolbar"
                                    android:layout_width="match_parent"
                                    android:layout_height="?attr/actionBarSize">
                                    <LinearLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:orientation="horizontal"
                                    android:weightSum="100">
                                    <ImageButton
                                    android:id="@+id/homeButton"
                                    android:layout_width="0dp"
                                    android:layout_height="match_parent"
                                    android:layout_weight="20"
                                    android:contentDescription="@string/home"
                                    app:srcCompat="@drawable/ic_home" />
                                    <TextView
                                    android:layout_width="0dp"
                                    android:layout_height="match_parent"
                                    android:layout_weight="60"
                                    android:gravity="center"
                                    android:text="@string/app_name"
                                    android:textSize="24sp"
                                    android:textStyle="bold"
                                    app:fontFamily="Sans Serif" />
                                    <ImageButton
                                    android:id="@+id/menuButton"
                                    android:layout_width="0dp"
                                    android:layout_height="match_parent"
                                    android:layout_weight="20"
                                    android:contentDescription="@string/menu"
                                    app:srcCompat="@drawable/ic_menu_black_24dp" />
                                    </LinearLayout>
                                    </android.support.v7.widget.Toolbar>

                                    </android.support.design.widget.AppBarLayout>

                                    <WebView
                                    android:id="@+id/webview"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

                                    </LinearLayout>





                                    share|improve this answer












                                    <?xml version="1.0" encoding="utf-8"?>
                                    <LinearLayout
                                    xmlns:android="http://schemas.android.com/apk/res/android"
                                    xmlns:app="http://schemas.android.com/apk/res-auto"
                                    xmlns:tools="http://schemas.android.com/tools"
                                    android:orientation="vertical"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent">

                                    <android.support.design.widget.AppBarLayout
                                    android:id="@+id/appbar"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content">
                                    <android.support.v7.widget.Toolbar
                                    android:id="@+id/toolbar"
                                    android:layout_width="match_parent"
                                    android:layout_height="?attr/actionBarSize">
                                    <LinearLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:orientation="horizontal"
                                    android:weightSum="100">
                                    <ImageButton
                                    android:id="@+id/homeButton"
                                    android:layout_width="0dp"
                                    android:layout_height="match_parent"
                                    android:layout_weight="20"
                                    android:contentDescription="@string/home"
                                    app:srcCompat="@drawable/ic_home" />
                                    <TextView
                                    android:layout_width="0dp"
                                    android:layout_height="match_parent"
                                    android:layout_weight="60"
                                    android:gravity="center"
                                    android:text="@string/app_name"
                                    android:textSize="24sp"
                                    android:textStyle="bold"
                                    app:fontFamily="Sans Serif" />
                                    <ImageButton
                                    android:id="@+id/menuButton"
                                    android:layout_width="0dp"
                                    android:layout_height="match_parent"
                                    android:layout_weight="20"
                                    android:contentDescription="@string/menu"
                                    app:srcCompat="@drawable/ic_menu_black_24dp" />
                                    </LinearLayout>
                                    </android.support.v7.widget.Toolbar>

                                    </android.support.design.widget.AppBarLayout>

                                    <WebView
                                    android:id="@+id/webview"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

                                    </LinearLayout>






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 12 '18 at 11:46









                                    Yıldırım

                                    17414




                                    17414






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.





                                        Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                        Please pay close attention to the following guidance:


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53254426%2fandroid-toolbar-and-webview%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown