0

Ich habe ein Webview in einem Koordinator Layout zusammen mit der Appbar. Meine Symbolleiste überlappt einen Teil meiner Webansicht und beim Scrollen ist die Werkzeugleiste ausgeblendet, wodurch der verborgene Teil der von der Werkzeugleiste verdeckten Ansicht sichtbar wird. Ich möchte, dass meine Webansicht unterhalb der Symbolleiste positioniert wird und übergeordnet wird, wenn die Symbolleiste ausgeblendet ist. Wie kann ich vorgehen? >Positionieren Sie das Webview unterhalb des Toolbar Coordinator Layouts

<?xml version="1.0" encoding="utf-8"> 

<android.support.design.widget.CoordinatorLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:ads="http://schemas.android.com/apk/res-auto" 
     android:background="#ffffff" 
     xmlns:app="http://schemas.android.com/tools" 
     android:fitsSystemWindows="true" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
      android:id="@+id/coordinatorLayout" 


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

> 

<android.support.v7.widget.Toolbar 
    android:layout_height="?attr/actionBarSize" 
    android:layout_width="match_parent" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:elevation="4dp" 
    app:layout_scrollFlags="scroll|enterAlways" 
    android:background="#e0e0e0" 
    app:titleTextColor="#FFFFFF" 
    app:popupTheme="@style/MyParentTheme.PopupOverlay" 

    android:id="@+id/toolbar" 


    /> 

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

<com.kenyanews.inception.NestedWebView 


    android:id="@+id/webview" 
    android:layout_width="match_parent" 
       android:layout_height="match_parent" 
    android:background="#55ff0000" 
app:layout_behavior="@string/  appbar_scrolling_view_behavior" /> 

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

hilft Ich denke, das Sie auf einfache Weise helfen http://stackoverflow.com/questions/28770530/how-to-hide-actionbar-toolbar-while-scrolling-down-in -webview –

Antwort

0

Ein anderer Weg, um die Werkzeugleiste zu verstecken ist diese:

Um die Symbolleiste zu verbergen können Ihr nur so etwas tun.

toolbar.animate() translationY (-toolbar.getBottom()). setInterpolator (new AccelerateInterpolator()). start();

Wunsch es Sie

+0

Ausblenden der Symbolleiste ist nicht das Problem ,, Es ist nur, dass die Symbolleiste einen Teil der Webansicht ausgeblendet, bevor Bildlauf auftritt – HM88