android - EditText on the bottom of Relative Layout overlays views under it -


linearlayout edittext on bottom overlays content of scrollview, filled programmatically. how avoid please? have simplified xml in vain in first version of message. have added full code now

i'd keep edittext height expandable.

enter image description here

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"             android:layout_width="fill_parent"             android:layout_height="fill_parent"             android:background="@color/backnormal"             android:orientation="vertical"     > <include layout="@layout/adview"          android:layout_alignparenttop="true"         />  <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"               android:layout_width="match_parent"               android:layout_height="wrap_content"               android:gravity="center_horizontal|center_vertical"               android:orientation="horizontal"               android:background="@color/back1"               android:layout_below="@+id/adview"         >     <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"                   android:layout_width="fill_parent"                   android:layout_height="wrap_content"                   android:layout_weight="1"                   android:orientation="vertical"             >          <textview                 android:id="@+id/textchatsubjecttitle"                 android:text='subject'                 android:gravity="left|center_vertical"                 android:layout_marginleft="10dp"                 android:layout_width="wrap_content"                 android:layout_weight="5"                 android:layout_height="wrap_content"                 android:textcolor="@color/text1"                 android:textappearance="?android:attr/textappearancemedium"                 android:textstyle="normal"                 />         <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"                       android:layout_width="match_parent"                       android:layout_height="wrap_content"                       android:gravity="left|center_vertical"                       android:orientation="horizontal"                 >             <textview                     android:id="@+id/textchatactn"                     android:text='0'                     android:gravity="left|center_vertical"                     android:layout_marginleft="10dp"                     android:paddingleft="3dp"                     android:paddingright="3dp"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:textcolor="@color/textwhite"                     android:background="@color/gray"                     android:textappearance="?android:attr/textappearancesmall"                     />             <textview                     android:id="@+id/textchatusers"                     android:text='users'                     android:gravity="left|center_vertical"                     android:layout_marginleft="10dp"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:textcolor="@color/darkgray"                     android:textappearance="?android:attr/textappearancesmall"                     android:textstyle="normal"                     />          </linearlayout>     </linearlayout>      <imageview             android:id="@+id/imagechatimagetitle"             android:layout_height="fill_parent"             android:layout_width="wrap_content"             android:layout_marginleft="5dp"             android:layout_marginright="5dp"             android:gravity="right"             /> </linearlayout>   <scrollview xmlns:android="http://schemas.android.com/apk/res/android"             android:id="@+id/scrollchat"             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:background="@color/backnormal"             android:orientation="vertical"             android:layout_below="@+id/top"         >     <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"                   android:id="@+id/linearchat"                   android:layout_width="match_parent"                   android:layout_height="wrap_content"                   android:orientation="vertical"             >     </linearlayout> </scrollview>  <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"               android:layout_width="match_parent"               android:layout_height="wrap_content"               android:background="@color/back1"               android:orientation="horizontal"               android:layout_alignparentbottom="true"         >     <imageview             android:id="@+id/buttonclip"             android:layout_width="0dp"             android:layout_height="wrap_content"             android:layout_marginright="5dp"             android:src="@drawable/clip32"             android:layout_weight="1"             android:layout_gravity= "center_vertical|center_horizontal"             />       <edittext             android:id="@+id/editchatmessage"             android:layout_width="0dp"             android:layout_height="wrap_content"             android:inputtype="textmultiline|textcapsentences"             android:minlines="1"             android:gravity="top|left"             android:maxlines="5"             android:maxlength="500"             android:layout_marginright="5dp"             android:text=''             android:layout_gravity= "center_vertical|center_horizontal"             android:textcolor="@color/text1"             android:textappearance="?android:attr/textappearancesmall"             android:layout_weight="5"             android:background="@drawable/edit"             android:scrollhorizontally="false"             android:cursorvisible="true"             android:textcursordrawable="@null"             />     <button             android:id="@+id/buttonchatsend"             android:text='>'             android:layout_marginright="5dp"             android:gravity="center"             android:layout_gravity= "center_vertical|center_horizontal"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:textcolor="@color/darkgray"             android:textappearance="?android:attr/textappearancemedium"             android:textstyle="bold"             android:background="@drawable/button_normal"             />  </linearlayout> </relativelayout> 

any ideas please? thanks!

i suggest using relative layout parent. , add rule above.

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">  <scrollview     android:id="@+id/scroll"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:layout_above="@+id/llbutton"     android:orientation="vertical">      <linearlayout         android:id="@+id/linear"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:orientation="vertical">      </linearlayout> </scrollview>  <linearlayout     android:id="@+id/llbutton"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:orientation="horizontal">      <edittext         android:id="@+id/editmessage"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:layout_gravity="center_vertical|center_horizontal"          android:gravity="top|left"         android:inputtype="textmultiline|textcapsentences"         android:maxlines="5"         android:minlines="3"         android:scrollhorizontally="false" />      <button         android:id="@+id/buttonsend"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center_vertical|center_horizontal"         android:gravity="center"         android:text='send'         android:textappearance="?android:attr/textappearancemedium" /> </linearlayout> 


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -