相关疑难解决方法(0)

Elevation increases with list position

I have a recyclerview with a CardView. Even if I dont specify the elevation explicitly, as the items get to the bottom of the screen, the elevation increases. Haven't seen this behavior anywhere else, what can this be caused from?

在此处输入图片说明

<android.support.v7.widget.CardView
    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="wrap_content"
    android:id="@+id/card_layout"
    app:cardElevation="6dp"
    app:cardPreventCornerOverlap="false"
    app:cardUseCompatPadding="true"
    android:foreground="?android:attr/selectableItemBackground"
    android:fitsSystemWindows="true"
    android:layout_marginLeft="4dp"
    android:layout_marginRight="4dp"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/schedule_card_height"
        android:orientation="horizontal">

        <RelativeLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1">

            <TextView
                android:id="@+id/schedule_item_category"
                style="@style/Base.TextAppearance.AppCompat.Caption"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:background="@drawable/background_eventlist_category"
                android:gravity="center"
                android:padding="5dp"
                android:textAllCaps="true"
                tools:text="Interview"/>
        </RelativeLayout>

        <View android:layout_height="match_parent"
              android:layout_width="1dp"
              android:background="@color/colorIcons"

              /> …
Run Code Online (Sandbox Code Playgroud)

android

6
推荐指数
1
解决办法
551
查看次数

CardView动态阴影不仅仅取决于海拔

在开发我的应用程序时,我创建了一个 RecyclerView,其中包含可扩展的 CardView,然后提到“嘿,为什么当我仅对卡片的垂直尺寸和扩展的不透明度进行动画处理时,高度会发生一些变化?”

然后我发现改变的不是高度——而是影子改变了。

有人听说过吗?难道只是界面绘制的一个未描述的东西?我不反对很酷的功能,但它只是让我有点困惑(我什至花了大约一个小时在谷歌指南上找到了一些关于它的信息)

我已经分享了证明“高度影响阴影绘制”这一想法的代码,但如果背后还有更多信息,请分享一些信息。

android android-cardview

0
推荐指数
1
解决办法
1352
查看次数

标签 统计

android ×2

android-cardview ×1