我想要一个隐形工具栏,但我希望显示后退箭头和标题。工具栏不能正确隐藏。请参阅详细信息
为了实现这一点,我做了以下内容:
<?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>
但是,我得到以下结果(看工具栏怎么还出现在那里):
我希望工具栏变得不可见,只显示标题和后退箭头。
请让我知道我该如何实现这一目标。
对不起,问题的格式不好。我仍然是这里的初学者。
设置背景透明会做的伎俩为您 –