I have an ImageView and I want it to have height of the 40% of the screen height. I am trying to accomplish it by constraint layout's guidelines, but I get runtime error "java.lang.AssertionError: BOTTOM". I think the error is that image becomes higher than screen's 40%, but I don't know how to fix the bug. here is my xml code.
<ImageView
android:id="@+id/apartment_main_image_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/apart"
app:layout_constraintBottom_toBottomOf="@+id/first_horizontal_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/first_horizontal_guideline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintGuide_percent="0.4"/>