我想在 textview 之前放置两个 Imageview。当 textview 是单行时,我得到所需的输出,见下文
如果 textview 是多行的,则会添加额外的空间,我不知道如何修复它。这是图像和代码
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/title_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp16"
android:layout_marginTop="@dimen/dp18"
android:layout_marginEnd="@dimen/dp16"
android:orientation="horizontal"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/som_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/dp8"
android:src="@drawable/ic_info_icon"
app:layout_constraintBottom_toBottomOf="@id/name_details"
app:layout_constraintEnd_toStartOf="@id/name_details" />
<ImageView
android:id="@+id/hand_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/dp8"
android:src="@drawable/ic_hand"
app:layout_constraintBottom_toBottomOf="@id/name_details"
app:layout_constraintEnd_toStartOf="@id/name_details" />
<TextView
android:id="@+id/name_details"
style="@style/sharp_sans_semi_bold_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"
tools:text="Mynameis RachelKaren " />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>