java - Android - Webview height is increased after scroll -
i developing android application in have used webview instead of textview use justify property on each list item .
list_item.xml
<?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="wrap_content" android:background="@color/white" android:orientation="vertical" android:padding="10dp" > <webview android:id="@+id/question" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="question" android:textsize="20sp" /> <view android:layout_width="fill_parent" android:layout_height="1dp" android:background="@color/color_black"/> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="20dp" android:weightsum="2" > <textview android:id="@+id/select_yes" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="yes" android:textsize="30sp" /> <textview android:id="@+id/select_no" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="no" android:textsize="30sp" /> </linearlayout> </linearlayout> customlistadapter.java
in getview()
string question = "<html><body>" + "<p align=\"justify\">" + data.get(position).getstudycrit() + "</p> " + "</body></html>"; holder.question.loaddata(question, "text/html", "utf-8"); if run application, 
but,after change scroll position , again go previous position. height of webview increased below,

note : there no issues textview, problem arised when replaced textview webview
please me finding solution.
you can use textview instead of webview , in textview can set text like:
textview.settext(html.fromhtml(question)); and can define maxlines textview.
Comments
Post a Comment