Greatings everybody.
I was working on a simple custom ArrayAdapter when I bumped into an overlapping issue.
This is the xml of my layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
    <TextView
        android:id="@+id/label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:text="@+id/label" />
    <EditText
        android:id="@+id/editText"
        android:hint="0"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_marginLeft="4dp"
        android:layout_marginRight="10dp">
    </EditText>
</RelativeLayout>
The problem is that if the label is too long it overlaps the edittext element.
I have also tried using an horizontal layout with weights but the edittext gets out of the screen when the label is too long.
I have read like 6 posts about the relative layout overlapping but nothing seems to work.
 
     
    