回答:
app:elevation="0dp"シャドウを削除するには、「AppBarLayout」の内部を使用するだけです。それはいつも私のために働いてきました。それがあなたのために働くことを願っています。
setOutlineProvider
                    この問題は、APIバージョンが21以上の場合にのみ発生します。標高を変更したくない場合は、以下を使用できます。
appBar.setOutlineProvider(null);
APIバージョンを確認することを忘れないでください
編集:
BlowはのソースコードですsetOutlineProvider。
   /**
     * Sets the {@link ViewOutlineProvider} of the view, which generates the Outline that defines
     * the shape of the shadow it casts, and enables outline clipping.
     * <p>
     * The default ViewOutlineProvider, {@link ViewOutlineProvider#BACKGROUND}, queries the Outline
     * from the View's background drawable, via {@link Drawable#getOutline(Outline)}. Changing the
     * outline provider with this method allows this behavior to be overridden.
     * <p>
     * If the ViewOutlineProvider is null, if querying it for an outline returns false,
     * or if the produced Outline is {@link Outline#isEmpty()}, shadows will not be cast.
     * <p>
     * Only outlines that return true from {@link Outline#canClip()} may be used for clipping.
     *
     * @see #setClipToOutline(boolean)
     * @see #getClipToOutline()
     * @see #getOutlineProvider()
     */
    public void setOutlineProvider(ViewOutlineProvider provider) {
        mOutlineProvider = provider;
        invalidateOutline();
    }
と言われている If the ViewOutlineProvider is null, if querying it for an outline returns false, or if the produced Outline is {@link Outline#isEmpty()}, shadows will not be cast.
したがって、影を削除したい場合は、を設定する代わりにこのメソッドを使用app:elevationすることをお勧めします。標高を変更して影を取り除くことは、一種の副作用のようです。また、標高を変更すると、場合によっては他の問題が発生することがあります。
使用bringToFront()したくないelevation="0dp"、ツールバーを非表示にするすべての人のために:
app:elevation="0dp"と組み合わせてandroid:translationZ="0.1dp"働いた。
<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay"
    app:elevation="0dp"
    android:translationZ="0.1dp"
    >
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@null"
        app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
              最新のappcompatバージョンではapp:elevation="0.1dp"、xml のトリック設定は機能しなくなります。
これまでに2つの解決策を見つけました。
を設定する代わりにapp:elevation、stateListAnimatorを使用してみてください。たとえば、コードでは:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    StateListAnimator stateListAnimator = new StateListAnimator();
    stateListAnimator.addState(new int[0], ObjectAnimator.ofFloat(appBarLayout, "elevation", 0.1f));
    appBarLayout.setStateListAnimator(stateListAnimator);
}より簡単な方法はapp:elevation="0dp"、通常どおりxmlで設定しますが、コードでは次のようになります。
appBarLayout.bringToFront();クレジットはこれらの2つの議論に行きます:
試しましたapp:elevation="0dp"が、ツールバーは消えてしまいましたが、app:elevation="0.1dp"ました。
これが誰かを助けることを願っています。
v25.0.0ます。
                    AppBarLayoutにapp:elevation = "0dp"を追加します。この例のように
<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:elevation="0dp"
    android:theme="@style/AppTheme.AppBarOverlay">
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
              プログラムでこれを使用できます:getSupportActionBar()。setElevation(0.0f);