问题描述
我有一个带有appbar_scrolling_view_behavior的recyclerview。我想将recyclerView的背景作为形状,但无法使形状背景透明:
我已将片段中的顶部布局设置为透明,并使仅包含活动的布局具有非透明背景,但是形状背景始终是包含活动布局中设置的任何颜色。
<?xml version="1.0" encoding="utf-8"?>
<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"
android:animateLayoutChanges="true"
android:background="@color/sysTransparent"
android:layoutDirection="ltr"
tools:context=".fragment.main.MainFragment">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:background="@color/sysTransparent"
android:layout_height="290dp">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed|enteralways">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.25"
android:scaleType="centerCrop"
android:src="@drawable/random_things" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_items"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_top_cut"
android:clipToPadding="false"
android:paddingBottom="100dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)