【发布时间】:2019-12-18 07:37:30
【问题描述】:
我有一个简单的ImageView 垃圾桶,我将它作为矢量资产导入。这是 XML
<ImageView
android:id="@+id/trashcan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="8dp"
android:elevation="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/ABtn"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/ic_trashcan" />
为什么即使有高度阴影也不显示?我想避免使用cardview 容器并使用它的影子,否则我将不得不将任何类型的ImageView 包含在cardView 中。
上面的ImageView's 父级是ConstraintLayout。
【问题讨论】:
-
它正在工作。我使用了相同的代码。
标签: android imageview android-elevation