J'ai un ImageView aligné à droite d'un TextView. Lorsque le texte est trop long, il redimensionne l'image ... Comment puis-je conserver la même taille pour l'image et forcer le TextView sur une nouvelle ligne?Impossible de réparer ImageView à l'intérieur de RelativeLayout
Voici le XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="@color/md_white_1000"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:id="@+id/btn_container_1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@color/blue"
android:layout_weight=".50"
android:layout_marginRight="1dp">
<Button
android:id="@+id/btn_1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
android:onClick="searchClicked"/>
<TextView
android:id="@+id/btn_text_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@color/md_white_1000"
android:paddingEnd="10dp"
android:paddingRight="10dp"
android:text="BTN1" />
<ImageView
android:id="@+id/btn_image_1"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/btn_text_1"
android:layout_toRightOf="@id/btn_text_1"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:src="@drawable/draw" />
</RelativeLayout>
</LinearLayout>
essayez android: ellipsize = "fin" dans la balise Textview – Onkar