I am new to Android. I Want to create an TextView like My Image.I search a lot, but I don't get Any Idea. In My TextView how to draw a line on Text. Please help me.
Any Help will be Appreciated.
I am new to Android. I Want to create an TextView like My Image.I search a lot, but I don't get Any Idea. In My TextView how to draw a line on Text. Please help me.
Any Help will be Appreciated.
you can directly create this line in layout file like this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/viewline">
<TextView
android:id="@+id/txts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello to all"
android:textColor="#000000"
android:layout_centerHorizontal="true"
android:textSize="25sp" />
<View
android:layout_width="150dp"
android:layout_height="1dp"
android:layout_marginTop="15dp"
android:layout_centerHorizontal="true"
android:background="#000000"></View>
</RelativeLayout>
which gives a view like:
For set Strikethrough.
textView.setPaintFlags(txtView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
textView.setText("10.00 AM");
For clear Strikethrough
textView.setPaintFlags(0);