how I can achieve one thing as in the example TextView with a line after the text
Asked
Active
Viewed 222 times
3 Answers
0
for adding line check this.
and align this view to the rightOf your text view. done
Community
- 1
- 1
Nilesh Deokar
- 2,897
- 28
- 48
0
Try this way this worked for me
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="Heelloos"
android:layout_marginLeft="10dp"/>
<View
android:layout_width="150dp"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:background="#ff00ff"/>
</LinearLayout>
OUTPUT
Jay Rathod RJ
- 10,843
- 5
- 33
- 56
Aditya Vyas-Lakhan
- 13,007
- 15
- 58
- 92
0
Try with this answer:
<?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="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Your Message: "
android:textAppearance="?android:attr/textAppearanceLarge" />
<View
android:layout_width="150dp"
android:layout_height="1dp"
android:layout_alignBottom="@+id/textView"
android:layout_gravity="bottom"
android:layout_toEndOf="@+id/textView"
android:layout_toRightOf="@+id/textView"
android:background="#FF0000FF" />
</RelativeLayout>
Dhruv
- 1,773
- 1
- 14
- 26