0
AppCompatツールバーを透明にして仰角を0にしたい。appを追加するとツールバーが消える:elevation属性
android:background
属性を追加すると、ツールバーは透明になりますが、app:elevation
属性を追加するとツールバーが完全に消えるだけです。上ボタンとタイトルが消え、背景が赤色または他の単色であれば、その色も消えます。
理由は何ですか?
は、ここであなただけのjavaファイルにfindViewById(R.id.appBar).bringToFront();
を記述する必要が私のアプリケーションバー
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:background="@android:color/transparent"
app:elevation="0dp"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
/>
</android.support.design.widget.AppBarLayout>
このリンクを試す - [Uberのような透過ツールバー](https://stackoverflow.com/a/43951266/6587502) –