Enabling scrollbar in EditText Android -


i have edittext on layout. below attributes have:

<edittext    android:id="@+id/entryidea"    android:layout_width="fill_parent"    android:layout_height="225sp"    android:gravity="top"    android:background="@android:drawable/editbox_background"    android:scrollbars="vertical"/> 

however, can see scrollbar can't scroll mouse/touch. thought may works if put corresponding listener since works on textview. apparently, isn't.

edittext et = (edittext)findviewbyid(r.id.entryidea); et.setmovementmethod(new scrollingmovementmethod()); 

can guys me on this?

thank in advance. sammy

in xml try setting edittext height not in layout_height, rather use android:lines attribute (btw, using sp not practice when setting size except font size. using dp/dip more natural in case).

meanwhile set layout_height wrap_content. otherwise xml presented (with changes i've mentioned) worked fine me without specifying movement method in code.

and of course, scroll bar appear when actual amount of lines of text in edittext larger that, indicated in android:lines attribute.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -