-1

I need help connecting the seekbar to the edit text. I want to limit the number of lines of the text.

On the seekbar, I put the number from 1-50, and for example, I put the number on 20, the number of lines is limited to 20 lines.

Community
  • 1
  • 1
Zeke
  • 1

1 Answers1

0

in your xml file add this code

<EditText 
android:id="@+id/editText2" 
android:layout_height="wrap_content" 
android:layout_width="fill_parent" 
android:maxLines="20" 
android:lines="20">

or programmatically

editText.setLines(maxlines); //maxlines=20
Tanim reja
  • 2,120
  • 1
  • 16
  • 23