Issue
I have problem in placing image view at middle of two different Layout. please help
Solution
This is achievable using ConstraintLayout: Please note the constraints of the ImageView.
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/container_top"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@android:color/holo_red_light"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/container_bottom"
android:layout_width="match_parent"
android:layout_height="400dp"
app:layout_constraintTop_toBottomOf="@id/container_top" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
app:layout_constraintBottom_toTopOf="@id/container_bottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/container_top" />
Answered By - Philipp Schumann
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.