Android making bottom tool bar not move to top of layout -


this sort of continuation of , wanted warning text @ bottom of screen (below bottom tool bar) when off line. when in offline mode looks correct:

when offline mode selected

however when hide offline mode pops top of layout, such (hiding want show):

enter image description here

i tried setting bottom tool bar android:layout_alignparentbottom="true", keep popping top when hide relativelayout textview in (offline mode) overlay each other when not hide offline mode.

probably easy bit more experienced android ui i. xml layout looks this:

<relativelayout     android:id="@+id/mainlyt"     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent">      <scrollview          android:id="@+id/formscrollview"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:layout_alignparenttop="true"         android:layout_above="@+id/bottombar" >         <linearlayout             android:id="@+id/formlayout"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:paddingleft="10dp"             android:paddingtop="15dp"             android:paddingright="10dp"             android:paddingbottom="15dp"             android:orientation="vertical" >         </linearlayout>      </scrollview>      <relativelayout         android:id="@+id/bottombar"         android:layout_height="wrap_content"         android:layout_width="match_parent"         android:orientation="horizontal"         android:layout_above="@+id/bottomoffline"          android:background="@color/form_toolbar">          <imagebutton             android:id="@+id/btnprev"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:onclick="btnprevclicked"             android:layout_alignparentleft="true"             android:focusableintouchmode="false"             android:background="?android:attr/selectableitembackground"             android:src="@drawable/toolbar_prev"             android:padding ="8dp"             />          <imagebutton             android:id="@+id/btnindex"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_torightof="@+id/btnprev"             android:onclick="btnindexclicked"             android:focusableintouchmode="false"             android:background="?android:attr/selectableitembackground"             android:src="@drawable/toolbar_index"             android:padding ="8dp"             />          <imagebutton             android:id="@+id/btnvalidation"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_torightof="@+id/btnindex"             android:onclick="btnvalidationclicked"             android:focusableintouchmode="false"             android:background="?android:attr/selectableitembackground"             android:src="@drawable/toolbar_validate"             android:padding ="8dp"             />          <imagebutton             android:id="@+id/btnnext"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignparentright="true"             android:onclick="btnnextclicked"             android:focusableintouchmode="false"             android:background="?android:attr/selectableitembackground"             android:src="@drawable/toolbar_next"             android:padding ="8dp"             />     <!-- buttons -->     </relativelayout>      <relativelayout         android:id="@+id/bottomoffline"         android:layout_width="match_parent"         android:layout_height="34dp"         android:layout_alignparentbottom="true"         android:background="@color/orangelight"         android:gravity="center_horizontal">          <textview             android:id="@+id/offline"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:focusableintouchmode="false"             android:text="offline mode"             android:textstyle="bold"             android:textcolor="@color/white"             android:padding ="8dp"             />     </relativelayout>  </relativelayout> 

thanks!

try wrapping bottom views in linearlayout , remove align fields 2 nested views

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:orientation="vertical">  <relativelayout     android:id="@+id/bottombar"     android:layout_height="wrap_content"     android:layout_width="match_parent"     android:orientation="horizontal"     android:background="@color/form_toolbar">      <imagebutton         android:id="@+id/btnprev"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:onclick="btnprevclicked"         android:layout_alignparentleft="true"         android:focusableintouchmode="false"         android:background="?android:attr/selectableitembackground"         android:src="@drawable/toolbar_prev"         android:padding ="8dp"         />      <imagebutton         android:id="@+id/btnindex"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_torightof="@+id/btnprev"         android:onclick="btnindexclicked"         android:focusableintouchmode="false"         android:background="?android:attr/selectableitembackground"         android:src="@drawable/toolbar_index"         android:padding ="8dp"         />      <imagebutton         android:id="@+id/btnvalidation"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_torightof="@+id/btnindex"         android:onclick="btnvalidationclicked"         android:focusableintouchmode="false"         android:background="?android:attr/selectableitembackground"         android:src="@drawable/toolbar_validate"         android:padding ="8dp"         />      <imagebutton         android:id="@+id/btnnext"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentright="true"         android:onclick="btnnextclicked"         android:focusableintouchmode="false"         android:background="?android:attr/selectableitembackground"         android:src="@drawable/toolbar_next"         android:padding ="8dp"         />     <!-- buttons --> </relativelayout>  <relativelayout     android:id="@+id/bottomoffline"     android:layout_width="match_parent"     android:layout_height="34dp"     android:background="@color/orangelight"     android:gravity="center_horizontal">      <textview         android:id="@+id/offline"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:focusableintouchmode="false"         android:text="offline mode"         android:textstyle="bold"         android:textcolor="@color/white"         android:padding ="8dp"         /> </relativelayout> 


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -