android - How to set height dynamically to listview with webview -
i have listview of webviews in scrollview. listview showing 5 rows proper height, till webview content not loaded. once content loaded in webview (through network call), can see 3 rows increased height, not sure weather listview height increased or scrollview height increased or not.
here xml code,
<scrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:fillviewport="true" android:scrollbars="vertical"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <relativelayout android:id="@+id/relativelayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical"> <imageview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignbottom="@+id/relativelayout" android:layout_alignparenttop="true" android:scaletype="centercrop" android:src="@drawable/bg_img_welcome" /> <imageview android:id="@+id/imageview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:paddingleft="25dp" android:paddingright="25dp" android:paddingtop="5dp" android:src="@drawable/rashays_rewards_logo" /> <imageview android:id="@+id/welcome" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/imageview" android:layout_centerhorizontal="true" android:paddingleft="25dp" android:paddingright="25dp" android:src="@drawable/welcome" /> <relativelayout android:id="@+id/relativelayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/welcome" android:gravity="center_horizontal" android:paddingbottom="10dp"> <insessor.typeface.textviewgothic android:id="@+id/customer_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:text="customer name" android:textcolor="@color/white" android:textsize="15dp" /> <com.github.siyamed.shapeimageview.roundedimageview android:id="@+id/customer_profile_picture" android:layout_width="100dp" android:layout_height="100dp" android:layout_below="@+id/customer_name" android:layout_centerhorizontal="true" android:layout_margintop="10dp" android:src="@drawable/user_placeholder" app:sibordercolor="@color/white" app:siborderwidth="3dp" app:siradius="6dp" app:sisquare="true" /> </relativelayout> </relativelayout> <linearlayout android:id="@+id/linearlayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/relativelayout1" android:background="@color/bg_drack_gray" android:gravity="center" android:orientation="vertical" android:padding="5dp"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/bg_drack_gray" android:gravity="center" android:orientation="horizontal"> <insessor.typeface.textviewchunk android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|center" android:padding="2dp" android:text="$" android:textcolor="@color/white" android:textsize="30dp" /> <insessor.typeface.textviewchunk android:id="@+id/reward_points" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="222" android:textcolor="@color/white" android:textsize="50dp" /> </linearlayout> <insessor.typeface.textviewgothic android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="rashay’s reward points" android:textcolor="@color/rashays_orenge" android:textsize="15dp" /> </linearlayout> <linearlayout android:id="@+id/linearlayout2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/linearlayout1" android:layout_gravity="center" android:background="@color/white" android:gravity="center" android:orientation="horizontal" android:paddingtop="2dp" android:weightsum="4"> <imageview android:id="@+id/redeem_dollar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:src="@drawable/redeem_dollar" /> <imageview android:id="@+id/contactus" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:src="@drawable/contactus" /> <imageview android:id="@+id/menu" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:src="@drawable/menu" /> <imageview android:id="@+id/booking" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:src="@drawable/booking" /> </linearlayout> <linearlayout android:id="@+id/linearlayout3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/linearlayout2" android:background="@color/white" android:gravity="center" android:orientation="vertical"> <insessor.typeface.textviewgothicbold android:layout_width="wrap_content" android:layout_height="wrap_content" android:letterspacing=".2" android:text="newsfeed" android:textsize="18sp" /> <view android:layout_width="match_parent" android:layout_height="1px" android:layout_gravity="center" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:layout_margintop="5dp" android:background="@color/separator" /> </linearlayout> <relativelayout android:id="@+id/relativelayout3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/linearlayout3" android:orientation="vertical"> <listview android:id="@+id/newsfeed_list" android:layout_width="match_parent" android:layout_height="wrap_content"> </listview> </relativelayout> <include layout="@layout/footer_text" android:layout_width="match_parent" android:layout_height="28dp" android:layout_below="@+id/relativelayout3" /> </relativelayout> </scrollview>
i think webview content loading late. updated code. added images,
sreenshot before webview content load,
sreenshot after webview content load,
i tried lot , resolved issue,i removed scrollview , added content of scrollview header , footer of listview.
thanks support, think not way use scrollview listview.
Comments
Post a Comment