3

I want to make a edit note and draw a paper line in background of that. Like the image below (as you can see, either vertical and horizontal line):

enter image description here

I don't know how can I draw it and how can I repeat it?

Omid Nazifi
  • 5,235
  • 8
  • 30
  • 56

1 Answers1

4

Here is the answer for your problem https://stackoverflow.com/a/10770670/619673

Of course you can implement it in textview (linked topic is about edittext) but it is quite the same operation (i think :D ). To use it in your xml you have to write instead of TextView your package path to custom widget class i.e. com.example.notepad.linkededit

enter image description here

Example:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <com.example.notepadline.LinedEditText
        android:id="@+id/tv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:singleLine="false"
        android:text="AAAA AAAA AAA AAAA AAAA AAA AAAA AAAA AAA AAAA AAAA AAA AAAA AAAA AAA AAAA AAAA AAA" />

</RelativeLayout>

The rest of information is in reference link.

Community
  • 1
  • 1
deadfish
  • 11,996
  • 12
  • 87
  • 136