Панель инструментов перекрытия WebView

Я создаю приложение, и у меня возникла проблема с панелью инструментов и веб-просмотром. Мой веб-просмотр перекрывает мою панель инструментов сверху. Как я могу это исправить?

Вот мой образец снимка экрана:

activity_main:
Панель инструментов перекрытия WebView

<android.support.constraint.ConstraintLayout
    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:background = "#ececec"
    tools:context = ".MainActivity">


<LinearLayout
    android:layout_width = "fill_parent"
    android:layout_height = "wrap_content"
    android:orientation = "vertical">

    <android.support.design.widget.AppBarLayout
        android:layout_width = "match_parent"
        android:layout_height = "match_parent"
        android:fitsSystemWindows = "true">

        <include
            android:id = "@+id/toolbar"
            layout = "@layout/toolbar_top" />

        <include
            android:id = "@+id/toolbar2"
            layout = "@layout/toolbar_bot" />

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

</LinearLayout>

  <android.support.v4.widget.NestedScrollView
    xmlns:android = "http://schemas.android.com/apk/res/android"
    xmlns:app = "http://schemas.android.com/apk/res-auto"
    android:layout_width = "match_parent"
    android:layout_height = "match_parent"
    android:layout_gravity = "fill_vertical"
    app:layout_behaviour = "@string/appbar_scrolling_view_behaviour">

    <!--STARTWEBVIEW -->
        <WebView
            android:id = "@+id/webview"
            android:layout_width = "match_parent"
            android:layout_height = "match_parent"
            android:visibility = "visible"/>
    <!--ENDWEBVIEW-->

  </android.support.v4.widget.NestedScrollView>

</android.support.constraint.ConstraintLayout>

Можете ли вы вставить код toolbar_top и toolbar_bot

1
0
611
1

Ответы 1

Попробуйте вот так:

<RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
xmlns:tools = "http://schemas.android.com/tools"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:background = "#ececec"
tools:context = ".MainActivity">

    <android.support.v7.widget.Toolbar
        android:id = "@+id/toolbar"
        android:layout_width = "match_parent"
        android:layout_height = "wrap_content"
        android:background = "#663300"
        android:minHeight = "?attr/actionBarSize"
         />

<!--STARTWEBVIEW -->
<WebView
    android:id = "@+id/webview"
    android:layout_width = "match_parent"
    android:layout_height = "match_parent"
    android:layout_above = "@id/toolbar1"
    android:layout_below = "@id/appBarLayout"
    android:visibility = "visible" />
<!--ENDWEBVIEW-->

<android.support.v7.widget.Toolbar
    android:id = "@+id/toolbar1"
    android:layout_width = "match_parent"
    android:layout_height = "wrap_content"
    android:layout_alignParentBottom = "true"
    android:background = "#663300"
    android:minHeight = "?attr/actionBarSize" />

</RelativeLayout>

Другие вопросы по теме