我想要一個隱形工具欄,但我希望顯示後退箭頭和標題。工具欄不能正確隱藏。請參閱詳細信息
爲了實現這一點,我做了以下內容:
<?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.abc.xyz.AboutActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
android:background="@color/toolbarTransparent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/header_about"
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="@color/colorAccent"/>
<ImageView
android:id="@+id/a"
android:layout_width="match_parent"
android:layout_height="70dp"
android:src="@drawable/a"
app:layout_anchor="@id/header_about"
app:layout_anchorGravity="bottom|center"/>
<include layout="@layout/content_about"/>
</android.support.design.widget.CoordinatorLayout>
但是,我得到以下結果(看工具欄怎麼還出現在那裏):
我希望工具欄變得不可見,只顯示標題和後退箭頭。
請讓我知道我該如何實現這一目標。
對不起,問題的格式不好。我仍然是這裏的初學者。
設置背景透明會做的伎倆爲您 –