Как я могу предотвратить перекрытие моего TextView?

альтернативный текст

Как я могу предотвратить это перекрытие, не уменьшая размер шрифта? Вот мой XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">   
    <TextView
        android:id="@+id/nameText"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:text="Symbol"
        android:textStyle="bold"
        android:textSize="24sp"
        android:layout_width="100dp"
        android:textColor="#4871A8"
        android:paddingTop="2dip"
        android:paddingLeft="5dip"
        android:paddingBottom="1dip"/>
    <TextView
        android:id="@+id/changeText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:gravity="right"     
        android:textSize="18sp"
        android:paddingTop="9dip"
        android:paddingRight="5dip"
        android:paddingBottom="1dip" android:text="13.07(+43.08%)" android:paddingLeft="5dip"/>  
    <ImageView android:layout_toLeftOf="@+id/changeText" android:layout_width="wrap_content" android:layout_height="fill_parent" android:id="@+id/verticalDivider" android:background="@drawable/stocks_selected_gradient"></ImageView><TextView
        android:id="@+id/priceText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@+id/changeText"
        android:gravity="right"     
        android:textStyle="bold"
        android:textSize="24sp"
        android:textColor="#4871A8"
        android:paddingTop="2dip"
        android:paddingBottom="1dip"
        android:paddingRight="25dip" android:text="15000"/>  

</RelativeLayout>

person Sheehan Alam    schedule 29.09.2010    source источник


Ответы (2)


Во втором TextView измените android:layout_alignParentRight="true" на

android:layout_toRightOf="@+id/nameText"
person Wroclai    schedule 29.09.2010
comment
это приводит к тому, что мой пользовательский интерфейс портится, и все перекрывается. Мне нужно, чтобы это текстовое представление было выровнено по правому краю. - person Sheehan Alam; 29.09.2010
comment
Тогда ваш текст слишком большой, уменьшите отступы. Правильное решение. - person Wroclai; 29.09.2010
comment
@ Шихан Алам, Чарли Шин прав, у вас слишком много текста на маленьком участке. - person Curtain; 29.09.2010

Инкапсулируйте TextView в LinearLayout (ориентация = горизонтальная). Для отдельных телевизоров укажите android:layout_weight (помните, что веса работают по-разному при использовании android:layout_width=fill_parent/wrap_content)

person Sameer Segal    schedule 29.09.2010