微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

全屏Imageview不覆盖Material AppbarLayout

如何解决全屏Imageview不覆盖Material AppbarLayout

伙计们。 我想为片段布局添加一个前景的全屏imageview。 我的布局包括全屏前景imageview。 但是它仅覆盖AppbarLayout之外的其余区域。 有没有办法覆盖包括appbar在内的全屏显示

<layout 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">
    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/app_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/white">
            <RelativeLayout
                android:id="@+id/title_bar"
                android:layout_width="match_parent"
                android:layout_height="?android:attr/actionBarSize"
                android:layout_marginTop="@dimen/spacing_l">
                ...
            </RelativeLayout>
            <com.google.android.material.tabs.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="38dp"
                android:background="@android:color/transparent"
                app:tabIndicatorHeight="4dp"
                app:tabIndicatorColor="#ffEB4E"
                app:tabSelectedTextColor="@android:color/black"
                app:tabTextAppearance="@style/TabLayoutTextSize"
                app:tabTextColor="@android:color/black" />
        </com.google.android.material.appbar.AppBarLayout>
        <androidx.viewpager2.widget.ViewPager2
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#F5F5F5"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:ignore="ContentDescription"
            android:clickable="true"
            android:focusable="true" />
    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。