1
I am creating a listview with adpater and I have a problem, I needed to add an image in the middle of the list to stay in the right corner, this image is only an arrow. how can I solve there it occupies all screen space even I set the image size and that is for it to stay in the right corner.
segue XML lista:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="15dp"
android:background="@drawable/color_list">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="UselessParent">
<TextView
android:text="@string/textview"
android:layout_width="match_parent"
android:textSize="18sp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:id="@+id/txtVencimento"
android:layout_marginLeft="10dp"
tools:ignore="RtlHardcoded" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txtPagamento"
tools:ignore="HardcodedText,RtlHardcoded"
android:layout_marginLeft="10dp"
android:elevation="50dp"
tools:targetApi="lollipop" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txtNumeDoc"
tools:ignore="HardcodedText,RtlHardcoded"
android:layout_marginLeft="10dp"
android:elevation="50dp"
tools:targetApi="lollipop" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txtHistorico"
tools:ignore="HardcodedText,RtlHardcoded"
android:layout_marginLeft="10dp"
android:elevation="50dp"
tools:targetApi="lollipop" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
app:srcCompat="@drawable/caratrblack"
android:id="@+id/imageView3"
tools:ignore="ContentDescription,RtlHardcoded"
android:layout_marginRight="15dp" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txtOrigem"
tools:ignore="HardcodedText,RtlHardcoded"
android:layout_marginLeft="10dp"
android:elevation="50dp"
tools:targetApi="lollipop" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txtValoresDesconto"
tools:ignore="HardcodedText,RtlHardcoded"
android:layout_marginLeft="10dp"
android:elevation="50dp"
tools:targetApi="lollipop" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txtMultaJuros"
tools:ignore="HardcodedText,RtlHardcoded"
android:layout_marginLeft="10dp"
android:elevation="50dp"
tools:targetApi="lollipop" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txtTotal"
tools:ignore="HardcodedText,RtlHardcoded"
android:layout_marginLeft="10dp"
android:elevation="50dp"
tools:targetApi="lollipop" />
</LinearLayout>
</RelativeLayout>
I’m sorry, didn’t understand what you said at the end? Only the image is in a horizontal layout?
– rodrigo.oliveira
It sits inside a horizontal Linearlayout. standing side by side with the textview
– Icaro
That way you can not do here, from Multiple root tags error!
– rodrigo.oliveira
Missing xml start. I will edit.
– Icaro
Thanks worked out!
– rodrigo.oliveira