我正在尝试使Android活动渗入通知区域,如下所示。 I have a solution,但我不喜欢它,因为它是纯粹的魔力 - 我不知道它为什么有效,它只是。在下面的代码示例中,我有一个CoordinatorLayout
,持有AppBarLayout
,持有CollapsingToolbarLayout
。如果以任何方式删除或更改了这些内容,则效果不再起作用。底部的LinearLayout
包含我想要使用的实际代码布局信息。如何在通知区域后面显示Android活动
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
<ImageView
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
/>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
这个答案可以帮助你吗? http://stackoverflow.com/questions/22192291/how-to-change-the-status-bar-color-in-android – Jackpile
@Teddis不,这个问题更多的是关于状态栏的颜色。在我的情况下,我希望状态栏是透明的,更重要的是,我希望我的活动的顶部出现在状态栏下方,如上例所示。 – JohnnyLambada