android - How to scroll the edittext inside the scrollview -
i have scrollview within there editext multiline. want scroll edittext see lower content can't done.
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <linearlayout android:layout_width="fill_parent" android:layout_height="50dp" android:background="@android:color/holo_blue_light" android:gravity="center" > <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="view complaint" android:textappearance="?android:attr/textappearancelarge" /> </linearlayout> <scrollview android:layout_width="fill_parent" android:layout_height="fill_parent" > <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:padding="20dp" > <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="15dp" android:text="order number 0100c1" android:textappearance="?android:attr/textappearancemedium" /> <textview android:id="@+id/textview3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="5dp" android:text="name of clientclient 1" android:textappearance="?android:attr/textappearancemedium" /> <textview android:id="@+id/textview4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="5dp" android:text="subject : measurement issues" android:textappearance="?android:attr/textappearancemedium" /> <textview android:id="@+id/textview5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="25dp" android:text="description" android:textappearance="?android:attr/textappearancemedium" /> <textview android:id="@+id/textview6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="15dp" android:text="lorem ipsum dolor sit down amet, sapien etiam, nunc amet dolor ac odio mauris justo. luctus arcu, urna praesent @ id quisque ac. arcu massa vestibulum malesuada, integer vivamus el/ european union " android:textappearance="?android:attr/textappearancemedium" /> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <textview android:id="@+id/textview7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="2dp" android:text="assign to" android:textappearance="?android:attr/textappearancemedium" /> <spinner android:id="@+id/spinner1" android:layout_width="match_parent" android:layout_height="40dp" android:entries="@array/array_name" /> </linearlayout> <edittext android:id="@+id/edittext1" android:layout_width="match_parent" android:layout_height="200dp" android:layout_margintop="15dp" android:background="#eeeeee" android:inputtype="textmultiline" android:singleline="false" android:text="android applications run exclusively on single thread default “ui thread” or “main thread”. android:textappearance="?android:attr/textappearancemedium" > </edittext> <textview android:id="@+id/textview5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="20dp" android:text="comment history" android:textappearance="?android:attr/textappearancemedium" /> <imageview android:id="@+id/imageview1" android:layout_width="fill_parent" android:layout_height="147dp" android:src="@drawable/adddd" /> <checkbox android:id="@+id/checkbox1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="10dp" android:text="close complaints" android:textappearance="?android:attr/textappearancelarge" /> <button android:id="@+id/login" style="?android:attr/buttonstylesmall" android:layout_width="match_parent" android:layout_height="45dp" android:layout_below="@+id/ll" android:layout_marginleft="20dp" android:layout_marginright="20dp" android:layout_margintop="15dp" android:background="@drawable/login_btn" android:text="submit" android:textcolor="@android:color/holo_blue_dark" android:textsize="25dp" android:textstyle="bold" /> </linearlayout> </scrollview>
can guys help me in . think edittext getting focus when cursor within it.
thanks..!!!!!
try this..
add below lines edittext
android:overscrollmode="always" android:scrollbarstyle="insideinset" android:scrollbars="vertical"
example
<edittext android:id="@+id/edittext1" android:layout_width="match_parent" android:layout_height="200dp" android:layout_margintop="15dp" android:background="#eeeeee" android:inputtype="textmultiline" android:singleline="false" android:overscrollmode="always" android:scrollbarstyle="insideinset" android:scrollbars="vertical" android:text="android applications run exclusively on single thread default “ui thread” or “main thread”. android:textappearance="?android:attr/textappearancemedium" > </edittext>
edit
programmatically
youredittext.setontouchlistener(new ontouchlistener() { public boolean ontouch(view v, motionevent event) { v.getparent().requestdisallowintercepttouchevent(true); switch (event.getaction() & motionevent.action_mask){ case motionevent.action_up: v.getparent().requestdisallowintercepttouchevent(false); break; } homecoming true; } });
android user-interface scrollview
No comments:
Post a Comment