Is there any codes which won’t overlap the textviews? Because if my name is long, it will overlap the Textview, Name:
Name: Abcdefghijk
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout android:id="@+id/relativeLayout1"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Name:"
android:textSize="20px" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/txtName"
android:layout_alignParentRight="true" android:textSize="20px"></TextView>
</RelativeLayout>
</LinearLayout>
Try this:
android:ellipsize=”marquee” cuts the text to the available space