首先,我不确定这个问题的措辞是否正确,但通过一些解释,我希望能让你明白我想问什么。
我有一个图像视图,它位于屏幕上半部分的15%左右,比如说图像视图的高度是30px,但是我放在该图像视图中的图像的高度是100px。目前,所有100px的图像都压缩到了30px。
我的问题是,如何只显示图像的30px,而不显示压缩到30px中的完整100px。
这是我的imageview
<ImageView
android:id="@+id/top_overlay"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/background_section"
app:layout_constraintBottom_toTopOf="@+id/top_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />