android - How to set listview to its original position? -


i have spent enough time make work listview setproperty "above" of layout align_parentbottom=true.

seems easy right? no not.

please see image can visualize problem , have idea it.

enter image description here

when user scrolls listview, home button @bottom hides.

and default, home button stays if list scrolling in idle state. needs done.

so problem after home button visibility goes gone listview fills whole space towards bottom means match_parent, thats fine.

but when scroll reaches idle state & visibility set visible last item of listview goes/hides behind home button.

it means listview not getting original place image shows.

tried making programmatically set "above" property of list home button align_parentbottom=true.

also tried changing whole layout linear layout , giving weight=1.

but didn't succeed. appreciated.

thanks.

layout file fragement:

<linearlayout     android:id="@+id/llmain"     android:visibility="visible"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="@color/white"     android:orientation="vertical">      <textview         android:id="@+id/txttitle"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginleft="@dimen/d_10"         android:layout_margintop="@dimen/d_5"         style="@style/text_size_title"         android:textcolor="@color/black"         android:textstyle="bold" />      <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_marginleft="@dimen/d_10"         android:layout_marginright="@dimen/d_10"         android:layout_margintop="@dimen/d_5">          <textview             android:id="@+id/txtdatetime"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:textcolor="@color/comment_n_time_color_text"             android:textsize="14sp" />          <linearlayout             android:layout_width="@dimen/d_1"             android:layout_height="match_parent"             android:layout_marginleft="@dimen/d_3"             android:layout_marginright="@dimen/d_3"             android:background="@color/comment_n_time_color" />          <imageview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center_vertical"             android:src="@drawable/ic_like" />          <textview             android:id="@+id/txtlike"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginleft="@dimen/d_3"             android:layout_marginright="@dimen/d_3"             android:textcolor="@color/comment_n_time_color_text"             android:textsize="14sp" />          <linearlayout             android:layout_width="@dimen/d_1"             android:layout_height="match_parent"             android:layout_marginleft="@dimen/d_3"             android:layout_marginright="@dimen/d_3"             android:background="@color/comment_n_time_color" />          <imageview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center_vertical"             android:src="@drawable/comment" />          <textview             android:id="@+id/txtcomment"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginleft="@dimen/d_3"             android:layout_marginright="@dimen/d_3"             android:textcolor="@color/comment_n_time_color_text"             android:textsize="14sp" />     </linearlayout>      <linearlayout         android:layout_width="match_parent"         android:layout_height="@dimen/article_detail_separator"         android:layout_margintop="@dimen/d_5"         android:background="@color/comment_n_time_color"></linearlayout>      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginleft="@dimen/d_10"         android:layout_margintop="@dimen/d_5"         android:text="@string/article_comment"         android:textappearance="?android:textappearancemedium"         android:textcolor="@color/black"         android:textstyle="bold" />      <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_marginleft="@dimen/d_10"         android:layout_marginright="@dimen/d_10"         android:layout_margintop="@dimen/d_5"         android:orientation="horizontal">          <edittext             android:id="@+id/txt_message"             android:layout_width="0dp"             android:layout_height="wrap_content"             android:layout_marginright="@dimen/d_10"             android:layout_weight="1"             android:hint="@string/article_comment_hint"             android:textcolor="@color/black" />          <imageview             android:id="@+id/img_send"             android:padding="@dimen/d_10"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center_vertical"             android:src="@drawable/send_button" />      </linearlayout>      <listview         android:id="@+id/listview_comments"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:cachecolorhint="@null"         android:listselector="@null">     </listview> </linearlayout> 

and activity layout:

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     android:id="@+id/parent"     android:background="@android:color/white">      <include         android:id="@+id/toolbaar"         layout="@layout/partial_toolbar"         android:layout_height="wrap_content"         android:layout_width="match_parent"         android:layout_alignparenttop="true" />      <view         android:layout_below="@+id/toolbaar"         android:id="@+id/viewline"         android:layout_width="match_parent"         android:layout_height="2dp"         android:background="@color/separator_color" />      <framelayout         android:layout_above="@+id/llbottom"         android:layout_below="@+id/viewline"         android:id="@+id/frame_container"         android:layout_width="match_parent"         android:layout_height="match_parent"></framelayout>      <linearlayout         android:id="@+id/llbottom"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_alignparentbottom="true"         android:orientation="vertical">          <include             android:id="@+id/img_home_"             layout="@layout/home_icon_footer"             android:layout_width="wrap_content"             android:layout_height="wrap_content" />     </linearlayout> </relativelayout> 

i think might able solve problem having 1 parent view, lets relative view, , have three different views inside relative view. relative view inside can have view elements above list view, scrollview listview inside , view, relative view, after home button , make sure align_parentbottom=true.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -