0

I have Multiline EditText in my project. I want limit of line in my EditText. I specify all the property's like android:lines="3", android:maxLines="2", android:gravity="top|left" etc. in it but it is not restricted to 3 line. It is going beyond that.

My EditText code is :

             <EditText
                android:id="@+id/etForDesc"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/edittext_back_profile"
                android:hint="@string/desc"
                android:imeOptions="actionDone"
                android:paddingBottom="10dp"
                android:paddingLeft="13dp"
                android:lines="3"
                android:maxLines="2"
                android:gravity="top|left"
                android:paddingTop="10dp"
                android:textStyle="normal" /> 

Please help me.

Thank you.

Dayanand Lande
  • 211
  • 4
  • 23
  • 1
    Just set maxLines. You are contradicting yourself setting lines > maxLines – zgc7009 May 06 '15 at 12:17
  • No its not working. I tried with that. I need max limit 3 lines. You should stop typing after 3 line fill. – Dayanand Lande May 06 '15 at 12:30
  • I think the answer you are looking for is here http://stackoverflow.com/questions/14672234/android-how-to-make-text-in-an-edittext-exactly-fixed-lines – belen May 06 '15 at 12:35

0 Answers0