Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android EditText Vertical Scrolling Problem

Tags:

android

I'm using an EditText of some predefined size, however when a user enters more text then fits in the text box, they aren't able to scroll the text with touch. Scrolling does work with a trackball.

What can I do to fix this?

like image 616
Bytecode Avatar asked May 25 '11 11:05

Bytecode


2 Answers

If you would like the text to scroll horizontally, define in your EditText XML tag:

android:scrollHorizontally="true"

If you would like a vertical scroll, define in your EditText XML tag:

android:scrollbars = "vertical"

Hope this helped.

like image 164
Vinay Avatar answered Oct 11 '22 23:10

Vinay


make the changes like the following to get scroller in your EditText

questionEntry.setScroller(new Scroller(myContext)); 
questionEntry.setMaxLines(1); 
questionEntry.setVerticalScrollBarEnabled(true); 
questionEntry.setMovementMethod(new ScrollingMovementMethod()); 

How to make edittext in Android scrollable?

Donot forget to vote if you feel my response is helpful for you

Thanks Deepak

like image 21
Sunil Kumar Sahoo Avatar answered Oct 11 '22 23:10

Sunil Kumar Sahoo