app:elevation="0dp"
を使用してツールバーの高度を取り除こうとしていますが、主なアクティビティxmlでのみ機能します。私が他の活動に行くとき、私はまだ標高、私のツールバーの下で標高を完全に取り除く方法を知ることができますか?すべてのアクティビティのツールバーで高度を削除する方法
app_bar_main.xmlは
<?xml version="1.0" encoding="utf-8"?>
<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:fitsSystemWindows="true"
tools:context="com.example.khalid.myapplication3.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
app:elevation="0dp">
<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>
<include layout="@layout/content_main" />
</android.support.design.widget.CoordinatorLayout>
これは私が前にこの問題に遭遇した他の活動のレイアウト
ツールバーと設定標高とのレイアウトを作成し、すべてのレイアウトに私は – Raghunandan
を必要とすることを含んでcontent_mainをフラグメントのコンテナとして使用します。だからあなたが提案したことをすれば、ツールバーは新しい断片に置き換えられます。 –
' 'と同じように、ツールバーにも同じことを行います。ツールバーを含むレイアウトには、ツールバーウィジェットの代わりにelevantionを0に設定します。それ以外のもの –
Raghunandan