I have a scrollable textView, and I want to limit the number of lines displayed, however xml properties are not working :
Find your textview by id:
TextView myTextBox=(TextView)findViewById(R.id.textBox);
Now use the setMaxLines function and assign the number of lines you require in it,say 20.
myTextBox.setMaxLines(20);
This limits your text box to show 20 lines only.