android - Two listview inside scrollView -
i have 2 listview. need scroll 1 listview continuation of list view. in between list there should text view. if utilize 2 listview , textview within scrollview icould not able scroll both list. if utilize listview without scrollview can see 2 listview scrolling not continues.
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#faf0be" > <button android:id="@+id/btnheader" android:layout_width="fill_parent" android:layout_height="40dp" android:background="#a1caf1" android:text="disoderdetail" /> <textview android:id="@+id/txttmtdnam" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/btnheader" android:layout_marginleft="@dimen/marginlleft" android:layout_margintop="@dimen/margintopp" android:text="jgjggjh" android:textcolor="#000000" /> <textview android:id="@+id/txtdisddtail" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/txttmtdnam" android:layout_marginleft="@dimen/marginlleft" android:layout_margintop="@dimen/margintopp" android:text="jgjggjh hjhhhjh jhjhh" android:textcolor="#000000" /> <relativelayout android:id="@+id/rvlytt2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignright="@+id/lyt2" android:layout_below="@id/txtdisddtail" android:layout_centerhorizontal="true" android:layout_marginbottom="@dimen/marginbottomm" android:layout_margintop="@dimen/margintop" android:orientation="horizontal" > <imageview android:id="@+id/starimg1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginright="5dp" android:layout_margintop="10dp" android:onclick="star1clicked" android:src="@drawable/starunselected" android:tag="1" /> <imageview android:id="@+id/starimg2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginright="5dp" android:layout_margintop="10dp" android:layout_torightof="@+id/starimg1" android:onclick="star2clicked" android:src="@drawable/starunselected" android:tag="2" /> <imageview android:id="@+id/starimg3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginright="5dp" android:layout_margintop="10dp" android:layout_torightof="@+id/starimg2" android:onclick="star3clicked" android:src="@drawable/starunselected" android:tag="3" /> <imageview android:id="@+id/starimg4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginright="5dp" android:layout_margintop="10dp" android:layout_torightof="@+id/starimg3" android:onclick="star4clicked" android:src="@drawable/starunselected" android:tag="4" /> </relativelayout> <scrollview android:id="@+id/scrlvw" android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_below="@id/rvlytt2" > <relativelayout android:id="@+id/rvl1" android:layout_width="fill_parent" android:layout_height="wrap_content" > <textview android:id="@+id/txtdcmt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_margintop="@dimen/margintop" android:text="comment" android:textcolor="#000000" /> <listview android:id="@+id/lstvwdis11" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/txtdcmt" > </listview> </relativelayout> <relativelayout android:id="@+id/rvl2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/rvl1" > <textview android:id="@+id/txtdrate" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@id/lstvwdis11" android:layout_margintop="@dimen/margintop" android:text="rate" android:textcolor="#000000" /> <listview android:id="@+id/lstvwdis12" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/txtdrate" > </listview> </relativelayout> </scrollview> <relativelayout android:id="@+id/rvlt22" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" > <edittext android:id="@+id/edtcmmt" android:layout_width="250dp" android:layout_height="50dp" android:layout_marginleft="5dp" android:background="#ffffff" android:hint="add comment" android:textcolor="#000000" /> <button android:id="@+id/btnpost" android:layout_width="130dp" android:layout_height="wrap_content" android:layout_torightof="@id/edtcmmt" android:onclick="onpostbtnclick" android:text="post" /> </relativelayout> </relativelayout>
this not right design starters if want stick design 1 quick prepare create code work set both of listviews within 1 more list view , set under scroll view. should solve problem of scrolling.
android android-layout listview android-listview
No comments:
Post a Comment