I am struggling with the problem of overlapping text. I have two text comments side by side
asd1234 | september 1
If the left text image is added with a large number of characters ("567"), the result will be
asd…23{lost chars} | september 1
Desired Result:
asd…567 | september 1
My textview attributes
android:ellipsize="middle"
android:maxLines="1"
android:scrollHorizontally="true"
Is there a way to make it work with attributes, or do I need to trim the string programmatically? What is the right way to do this? Thanks
EDIT
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/background_dark"
android:orientation="horizontal">
<TextView
android:id="@+id/header"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/date"
android:layout_centerVertical="true"
android:maxLines="1"
android:textColor="@android:color/holo_blue_dark" />
<TextView
android:id="@+id/date"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:maxLines="1"
android:textColor="@android:color/holo_blue_dark" />
</RelativeLayout>
gkiko source
share