Android 添加app:elevation属性时工具栏消失
我希望我的AppCompat工具栏是透明的,高度为零 添加Android 添加app:elevation属性时工具栏消失,android,Android,我希望我的AppCompat工具栏是透明的,高度为零 添加android:background属性使工具栏透明,但添加app:elevation属性只会使工具栏完全消失;“向上”按钮和标题将消失,如果背景为红色或其他纯色,则该颜色也将消失 知道为什么吗 这是我的应用程序栏 <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_paren
android:background
属性使工具栏透明,但添加app:elevation
属性只会使工具栏完全消失;“向上”按钮和标题将消失,如果背景为红色或其他纯色,则该颜色也将消失
知道为什么吗
这是我的应用程序栏
<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>
您只需编写
findViewById(R.id.appBar).bringToFront()代码>在java文件中。
希望它对您有所帮助?您只需编写findviewbyd(R.id.appBar).bringToFront()代码>在java文件中。
希望对您有所帮助?尝试此链接-尝试此链接-