如何使用可见的工具栏项制作透明的自定义工具栏?我有一个带有回收站视图的页面,我想在我的透明工具栏下看到我的回收站视图,其中包含可见的工具栏项目。它应该看起来像这样
问问题
138 次
2 回答
0
像这样设置工具栏:
<android.support.v7.widget.Toolbar
android:id="@+id/tbsobre"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
于 2017-07-17T10:36:14.760 回答
0
试试这个
<android.support.v7.widget.Toolbar
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:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/background_toolbar" />
现在在 res/drawble 中创建一个 background_toolbar.xml
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="@android:color/transparent"
android:startColor="#66000000"/>
</shape>
现在设置你的工具栏
于 2017-07-17T10:36:17.140 回答