ScrollView don't scroll util end - android

I really do not understand why in a device with a small screen the scrollview not scroll to the end.
Look q'm saying:
I researched and saw that could be caused due to the 'margin' but I do not remember to be using.
Here is my layout file with the ScrollView:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context="br.com.petrobressa.Inicio$PlaceholderFragment"
android:fillViewport="false"
android:layout_weight="1">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="#dimen/activity_horizontal_margin">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTextLabel"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="#+id/view">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editText"
android:hint="Agendar para o dia..."
android:imeActionLabel="Data"
android:drawableRight="#drawable/ic_today"
android:layout_below="#+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:editable="false"
android:inputType="date"
android:maxLines="1"
android:singleLine="true"/>
</android.support.design.widget.TextInputLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Selecionar horario:"
android:id="#+id/textView"
android:textColor="#color/colorPrimaryDark"
android:layout_below="#+id/view"
android:layout_alignLeft="#+id/view"
android:layout_alignStart="#+id/view" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="#+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="#+id/linearLayout3">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/ivImage"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="#drawable/ic_alarm"
android:tint="#color/colorPrimaryDark"
android:layout_marginTop="12dp" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/spinner"
android:layout_below="#+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:spinnerMode="dialog" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="8dp"
android:layout_gravity="center_horizontal"
android:gravity="center|center_vertical|center_horizontal">
<ImageView
android:id="#+id/ivImageNotificar"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="#drawable/ic_info"
android:tint="#color/colorPrimaryDark" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Este horario ja foi reservado!"
android:textStyle="bold"
android:gravity="center_horizontal"
android:id="#+id/tvNotificar" />
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Selecionar tipo de veiculo:"
android:id="#+id/textView2"
android:textColor="#color/colorPrimaryDark"
android:layout_below="#+id/linearLayout3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="false" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/spinner2"
android:spinnerMode="dropdown"
android:layout_alignParentStart="true"
android:layout_below="#+id/textView2"
android:layout_alignParentLeft="true" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Reservar"
android:background="#color/colorPrimary"
android:textColor="#color/colorIcons"
android:id="#+id/button"
android:layout_below="#+id/spinner2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_margin="50dp" />
</RelativeLayout>
</ScrollView>

Related

Push down TextView below EditText multiline if the size starts to grow

Im trying to put a TextView below a multiline EditText and if the EditText starts to grow in height the TextView needs to stay below the EditText, right now if the EditText starts to grow it just covers the TextView below, they are inside a RelativeLayout. Here is the XML of the two objects:
<EditText
android:id="#+id/descripcion_actividad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/descripcion_actividad_label"
android:layout_alignBottom="#+id/descripcion_actividad_label"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_toEndOf="#+id/cantidad"
android:layout_toRightOf="#+id/cantidad"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="#+id/hora_inicio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/descripcion_actividad"
android:layout_alignParentBottom="false"
android:layout_below="#+id/descripcion_actividad"
android:layout_alignStart="#+id/descripcion_actividad"
android:text="TextView" />
EDIT: Whole layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_third_form_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="dbxprts.terminaltrak.PlanTrabajoActivity">
<android.support.v7.widget.Toolbar
android:id="#+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:theme="#style/ToolBarStyle" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/my_toolbar"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="#+id/activity_third_form"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="dbxprts.terminaltrak.PlanTrabajoActivity">
<Spinner
android:id="#+id/liberado_rechazado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/tipo_fase"
android:layout_alignStart="#+id/tipo_fase"
android:layout_below="#+id/tipo_fase"
android:layout_marginTop="5dp"
android:entries="#array/array_liberado_rechazado"
android:visibility="gone" />
<Spinner
android:id="#+id/id_cliente"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/id_cliente_label"
android:layout_marginLeft="35dp"
android:layout_toEndOf="#+id/id_realizo_label"
android:layout_toRightOf="#+id/id_realizo_label" />
<TextView
android:id="#+id/hora_inicio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/descripcion_actividad"
android:layout_alignParentBottom="false"
android:layout_alignStart="#+id/descripcion_actividad"
android:layout_below="#+id/descripcion_actividad"
android:layout_marginTop="20dp"
android:text="TextView" />
<TextView
android:id="#+id/descripcion_actividad_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/id_cliente_label"
android:layout_marginTop="35dp"
android:text="Descripción Actividad:" />
<TextView
android:id="#+id/id_cliente_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/id_operacion_label"
android:layout_marginTop="35dp"
android:text="ID Cliente:" />
<Spinner
android:id="#+id/id_operacion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/id_operacion_label"
android:layout_marginLeft="25dp"
android:layout_toEndOf="#+id/id_operacion_label"
android:layout_toRightOf="#+id/id_operacion_label" />
<Spinner
android:id="#+id/id_supervisor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/id_supervisor_label"
android:layout_marginLeft="25dp"
android:layout_toEndOf="#+id/id_supervisor_label"
android:layout_toRightOf="#+id/id_supervisor_label" />
<TextView
android:id="#+id/id_operacion_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/cantidad_label"
android:layout_marginTop="35dp"
android:text="ID Operación:" />
<EditText
android:id="#+id/cantidad"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/cantidad_label"
android:layout_alignBottom="#+id/cantidad_label"
android:layout_toEndOf="#+id/id_supervisor_label"
android:layout_toRightOf="#+id/id_supervisor_label"
android:ems="10"
android:inputType="number" />
<TextView
android:id="#+id/cantidad_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/id_supervisor_label"
android:layout_centerVertical="true"
android:layout_marginTop="35dp"
android:text="Cantidad:" />
<TextView
android:id="#+id/id_programo_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tipo_fase_label"
android:layout_marginTop="35dp"
android:text="ID Programó:"
android:textSize="15sp" />
<Spinner
android:id="#+id/tipo_fase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/tipo_fase_label"
android:layout_marginLeft="25dp"
android:layout_toEndOf="#+id/id_plan_label"
android:layout_toRightOf="#+id/id_plan_label"
android:dropDownWidth="match_parent"
android:minWidth="100dip" />
<TextView
android:id="#+id/id_supervisor_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/id_realizo_label"
android:layout_marginTop="35dp"
android:text="ID Supervisor:" />
<Spinner
android:id="#+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/id_realizo_label"
android:layout_alignLeft="#+id/tipo_fase"
android:layout_alignStart="#+id/tipo_fase"
android:layout_marginLeft="25dp" />
<Button
android:id="#+id/confirmar_cambios"
android:layout_width="120dp"
android:layout_height="55dp"
android:layout_alignParentBottom="true"
android:layout_below="#+id/descarga_cronometro"
android:layout_centerHorizontal="true"
android:elevation="0dp"
android:text="Registrar Fase"
android:textAllCaps="false"
android:visibility="gone" />
<TextView
android:id="#+id/hora_inicio_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignTop="#+id/hora_inicio"
android:text="Hora Inicio:" />
<Spinner
android:id="#+id/via"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/id_programo_label"
android:layout_marginLeft="25dp"
android:layout_toEndOf="#+id/id_programo_label"
android:layout_toRightOf="#+id/id_programo_label" />
<TextView
android:id="#+id/tipo_fase_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/id_plan_label"
android:layout_marginTop="35dp"
android:layout_toLeftOf="#+id/tipo_fase"
android:layout_toStartOf="#+id/tipo_fase"
android:text="Tipo Fase:"
android:textSize="15sp" />
<TextView
android:id="#+id/id_plan_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="ID Plan Label:"
android:textSize="15sp" />
<EditText
android:id="#+id/descripcion_actividad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/descripcion_actividad_label"
android:layout_alignBottom="#+id/descripcion_actividad_label"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_toEndOf="#+id/cantidad"
android:layout_toRightOf="#+id/cantidad"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="#+id/id_realizo_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/id_programo_label"
android:layout_marginTop="35dp"
android:text="ID Realizó:" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
Place the EditText and Textview inside a LinearLayout with orientation as vertical
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/rootLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="#+id/descripcion_actividad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
--------------------------
--------------------------
android:inputType="textMultiLine" />
<TextView
android:id="#+id/hora_inicio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
--------------------------
--------------------------
android:text="TextView" />
</LinearLayout>
Use a Linearlayout instead .
<LinearLayout
android:layout_width="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_height="wrap_content">
<EditText
android:id="#+id/descripcion_actividad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="#+id/hora_inicio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
</LinearLayout>
OR With Relative Layout use
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<EditText
android:id="#+id/descripcion_actividad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="#+id/hora_inicio"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content"
android:layout_below="#+id/descripcion_actividad"
android:text="TextView" />
</RelativeLayout>

Unable to get rating bar to align with text View

I am trying to create a scrollable list with ratingbars and textviews.
However I am unable to get them to align correctly. I would like even spacing between all textviews and rating bars..
I have tried to use the layout_below but this does not produce what I would like, I have also tried dragging, but this also does not create the wanted effect.
Any help would be appreciated :)
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimaryDark"
tools:context="uk.co.neverendingsport.neverendingsport.LoginActivity">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Continue"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="13dp"
android:id="#+id/button" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Sports"
android:textSize="30sp"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_below="#+id/textView4"
android:layout_alignParentStart="true">
<TextView
android:id="#+id/footballTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Football"
android:textSize="30sp"
android:layout_above="#+id/cyclingRatingBar"
android:layout_alignParentStart="true" />
<RatingBar
android:id="#+id/footballRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true" />
<TextView
android:id="#+id/cyclingTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cycling"
android:textSize="30sp"
android:layout_above="#+id/badmintonTextView"
android:layout_alignParentStart="true"
android:layout_marginBottom="10dp" />
<RatingBar
android:id="#+id/cyclingRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/footballRatingBar"
android:layout_alignParentEnd="true" />
<TextView
android:id="#+id/badmintonTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Badminton"
android:textSize="30sp"
android:layout_below="#+id/cyclingRatingBar"
android:layout_alignParentStart="true"
android:layout_marginBottom="10dp"/>
<RatingBar
android:id="#+id/badmintonRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/runningTextView"
android:layout_alignParentEnd="true" />
<TextView
android:id="#+id/runningTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Running"
android:textSize="30sp"
android:layout_below="#+id/badmintonTextView"
android:layout_alignParentStart="true"
android:layout_marginBottom="10dp"/>
<RatingBar
android:id="#+id/runningRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/badmintonRatingBar"
android:layout_alignParentEnd="true" />
<TextView
android:id="#+id/swimmingTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Swimming"
android:textSize="30sp"
android:layout_below="#+id/runningTextView"
android:layout_alignParentStart="true"
android:layout_marginBottom="10dp"/>
<RatingBar
android:id="#+id/swimmingRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/runningRatingBar"
android:layout_alignParentEnd="true" />
<TextView
android:id="#+id/golfTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Golf"
android:textSize="30sp"
android:layout_below="#+id/swimmingTextView"
android:layout_alignParentStart="true"
android:layout_marginBottom="10dp"/>
<RatingBar
android:id="#+id/golfRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/swimmingRatingBar"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
Image of current layout
Here is the answer that works fine for me
<?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">
<TextView
android:id="#+id/textView2"
style="#style/Base.TextAppearance.AppCompat.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="Select Sports" />
<TextView
android:id="#+id/textView6"
style="#style/Base.TextAppearance.AppCompat.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/ratingBar"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="17dp"
android:layout_toLeftOf="#+id/ratingBar"
android:layout_toStartOf="#+id/ratingBar"
android:text="Football" />
<RatingBar
android:id="#+id/ratingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView2" />
<RatingBar
android:id="#+id/ratingBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/ratingBar" />
<RatingBar
android:id="#+id/ratingBar3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/ratingBar2"
android:layout_alignStart="#+id/ratingBar2"
android:layout_below="#+id/ratingBar2" />
<RatingBar
android:id="#+id/ratingBar4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/ratingBar3"
android:layout_alignStart="#+id/ratingBar3"
android:layout_below="#+id/ratingBar3" />
<TextView
android:id="#+id/textView7"
style="#style/Base.TextAppearance.AppCompat.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/ratingBar3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="17dp"
android:layout_toLeftOf="#+id/textView2"
android:text="Cycling" />
<TextView
android:id="#+id/textView8"
style="#style/Base.TextAppearance.AppCompat.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/ratingBar4"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="14dp"
android:layout_toLeftOf="#+id/ratingBar3"
android:text="Badminton" />
<TextView
android:id="#+id/textView9"
style="#style/Base.TextAppearance.AppCompat.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/ratingBar4"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="16dp"
android:layout_toLeftOf="#+id/ratingBar4"
android:text="Running" />
</RelativeLayout>]
final output
First of all you need to add rating bar to parent layout and later textview to the parent layout
Try this
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimaryDark"
tools:context="uk.co.neverendingsport.neverendingsport.LoginActivity">
<Button
android:id="#+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="13dp"
android:text="Continue" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="Select Sports"
android:textSize="30sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_below="#+id/textView4">
<RelativeLayout
android:id="#+id/relativeFootball"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/footballTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Football"
android:textSize="30sp" />
<RatingBar
android:id="#+id/footballRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeCycle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/relativeFootball">
<TextView
android:id="#+id/cyclingTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Cycling"
android:textSize="30sp" />
<RatingBar
android:id="#+id/cyclingRatingBar"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeBadminton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/relativeCycle">
<TextView
android:id="#+id/badmintonTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Badminton"
android:textSize="30sp" />
<RatingBar
android:id="#+id/badmintonRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeRunning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/relativeBadminton">
<TextView
android:id="#+id/runningTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Running"
android:textSize="30sp" />
<RatingBar
android:id="#+id/runningRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeSwimming"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/relativeRunning">
<TextView
android:id="#+id/swimmingTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:text="Swimming"
android:textSize="30sp" />
<RatingBar
android:id="#+id/swimmingRatingBar"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeGolf"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/relativeSwimming">
<TextView
android:id="#+id/golfTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Golf"
android:textSize="30sp" />
<RatingBar
android:id="#+id/golfRatingBar"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimaryDark"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Continue"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="13dp"
android:id="#+id/button" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Sports"
android:textSize="28sp"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView4"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="#+id/footballTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Football"
android:textSize="28sp"
android:layout_weight="1"
android:layout_above="#+id/cyclingRatingBar"
/>
<RatingBar
android:id="#+id/footballRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="#+id/cyclingTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cycling"
android:textSize="28sp"
android:layout_weight="1"
android:layout_above="#+id/badmintonTextView"
android:layout_marginBottom="10dp" />
<RatingBar
android:id="#+id/cyclingRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/footballRatingBar"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="#+id/badmintonTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Badminton"
android:textSize="28sp"
android:layout_below="#+id/cyclingRatingBar"
android:layout_weight="1"
android:layout_marginBottom="10dp"/>
<RatingBar
android:id="#+id/badmintonRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/runningTextView"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="#+id/runningTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Running"
android:textSize="28sp"
android:layout_weight="1"
android:layout_below="#+id/badmintonTextView"
android:layout_marginBottom="10dp"/>
<RatingBar
android:id="#+id/runningRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/badmintonRatingBar"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="#+id/swimmingTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Swimming"
android:textSize="28sp"
android:layout_weight="1"
android:layout_below="#+id/runningTextView"
android:layout_marginBottom="10dp"/>
<RatingBar
android:id="#+id/swimmingRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/runningRatingBar"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="#+id/golfTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Golf"
android:textSize="28sp"
android:layout_weight="1"
android:layout_below="#+id/swimmingTextView"
android:layout_marginBottom="10dp"/>
<RatingBar
android:id="#+id/golfRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/swimmingRatingBar"
>
</RatingBar>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

Horizontal LinearLayout inside Vertical LinearLayout

I want to display an horizontal linearlayout which content 3 imageview inside a vertical linearLayout
But i have a problem as you can see
Only the first Imageview is displayed , and he is in the center .
I changed the gravity for the other Imageview (left and right) but nothing changed .
The code :
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/activity_form"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context="info.androidhive.navigationdrawer.activity.FormActivity"
android:weightSum="1"
android:theme="#style/ThemeOverlay.AppCompat.Dark">
<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Ajouter Votre Annonce"
android:gravity="center"
android:textColor="#000000"
android:textSize="22sp"
/>
<Spinner
android:id="#+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="34dp"
android:layout_below="#+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:entries="#array/cat_arrays"
android:prompt="#string/cat_prompt"
/>
<RadioButton
android:id="#+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="23dp"
android:text="Offre"
android:layout_below="#+id/spinner"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textColor="#000000"
/>
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/radioButton"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:text="Demande"
android:textColor="#000000"
/>
<Spinner
android:id="#+id/spinner4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/spinner3"
android:layout_marginTop="17dp"
android:entries="#array/vil_arrays"
android:prompt="#string/vil_prompt"
android:textColor="#808080"
/>
<EditText
android:id="#+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:ems="10"
android:inputType="textPersonName"
android:hint="Titre de l'Annonce"
android:layout_below="#+id/spinner4"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textColorHint="#808080"
android:textColor="#000000"
/>
<EditText
android:id="#+id/editText8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:ems="10"
android:inputType="textPersonName"
android:hint="Prix en UM"
android:layout_below="#+id/spinner4"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textColorHint="#808080"
android:textColor="#000000"
/>
<EditText
android:id="#+id/editText4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/editText"
android:layout_marginTop="16dp"
android:ems="10"
android:inputType="textPersonName"
android:hint="Description"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:textColorHint="#808080"
android:paddingBottom="75dp"
android:textColor="#000000"/>
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="27dp"
android:text="Vos Photos"
android:gravity="center"
android:textColor="#000000"
android:textSize="22sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageView
android:id="#+id/img1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/imgadd"
android:gravity="left"
/>
<ImageView
android:id="#+id/img2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/imgadd"
android:gravity="center"/>
<ImageView
android:id="#+id/img3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/imgadd"
android:gravity="right"/>
</LinearLayout>
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/button3"
android:layout_centerHorizontal="true"
android:layout_marginTop="23dp"
android:text="Vos Informations"
android:gravity="center"
android:textColor="#000000"
android:textSize="22sp"
/>
<RadioButton
android:id="#+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button3"
android:layout_alignStart="#+id/button3"
android:layout_below="#+id/textView5"
android:text="Professionel"
android:textColor="#000000"
/>
<RadioButton
android:id="#+id/radioButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/radioButton3"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:text="Particulier"
android:textColor="#000000"
/>
<EditText
android:id="#+id/editText5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button3"
android:layout_alignStart="#+id/button3"
android:layout_below="#+id/radioButton3"
android:layout_marginTop="26dp"
android:ems="10"
android:inputType="textPersonName"
android:hint="Nom et Prenom"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textColorHint="#808080"
/>
<EditText
android:id="#+id/editText6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText5"
android:layout_alignParentBottom="true"
android:layout_alignStart="#+id/editText5"
android:layout_marginBottom="10dp"
android:ems="10"
android:inputType="textPersonName"
android:hint="Telephone"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textColorHint="#808080"
/>
<EditText
android:id="#+id/editText7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText6"
android:layout_alignParentBottom="true"
android:layout_alignStart="#+id/editText6"
android:layout_marginBottom="10dp"
android:ems="10"
android:inputType="textPassword"
android:hint="Mot de passe"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textColorHint="#808080"/>
<Button
android:id="#+id/button4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:text="Déposez votre Annonce"
android:background="#a4c639"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:textColorHint="#808080"/>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageView
android:id="#+id/img1"
android:layout_width="0dp"
android:layout_weight = "1"
android:layout_height="wrap_content"
android:src="#drawable/imgadd"/>
<ImageView
android:id="#+id/img2"
android:layout_width="0dp"
android:layout_weight = "1"
android:layout_height="wrap_content"
android:src="#drawable/imgadd"/>
<ImageView
android:id="#+id/img3"
android:layout_width="0dp"
android:layout_weight = "1"
android:layout_height="wrap_content"
android:src="#drawable/imgadd"/>
</LinearLayout>
Try this code:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageView
android:id="#+id/img1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/imgadd"/>
<ImageView
android:id="#+id/img2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/imgadd"/>
<ImageView
android:id="#+id/img3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/imgadd"/>
</LinearLayout>
It can be fixed in multiple ways. What i would do is to assign layout_weight tag to all 3 images in the horizontal linear layout . something like this.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageView
android:id="#+id/img1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/imgadd"
android:layout_weight ="1"
/>
<ImageView
android:id="#+id/img2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight ="1"
android:src="#drawable/imgadd"
/>
<ImageView
android:id="#+id/img3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight ="1"
android:src="#drawable/imgadd"
/>
</LinearLayout>
Also remove the gravity tag in all three image views .

(Android studio) ScrollView won't scroll all the way to the bottom

im trying to put a scroll view inside a frame layout. My scroll view is not scrolling all the way to bottom. this is my xml code. It is working when i give a padding to scroll view. but i need a better answer. because giving a padding will make a white margin below my application. Thank you!
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
// this is your first layout to put the big image
// use src or backgroud image as per requirement
<LinearLayout
android:background="#drawable/bg"
android:layout_width="match_parent"
android:layout_height="180dp">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/imageView"
android:background="#drawable/overly" />
</LinearLayout>
// this is your bottom layout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffc9c9c9"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:id="#+id/relativeLayout"
android:layout_marginTop="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Anna Huffmunster"
android:id="#+id/textView2"
android:textStyle="bold"
android:textSize="20dp"
android:gravity="center"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:paddingTop="40dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Colombo Sri lanka"
android:id="#+id/txt_location"
android:textSize="15dp"
android:gravity="center"
android:textStyle="italic"
android:textColor="#696969"
android:paddingBottom="7dp"
android:paddingTop="5dp"
android:layout_below="#+id/textView2"
android:layout_centerHorizontal="true" />
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/scrollView"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_below="#+id/relativeLayout"
android:layout_marginTop="12dp"
android:id="#+id/relativeLayout2">
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/imageButton"
android:background="#drawable/call_button"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/imageButton2"
android:background="#drawable/chat_button"
android:layout_alignParentTop="true"
android:layout_toStartOf="#+id/imageButton"
android:layout_marginRight="30dp" />
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/imageButton3"
android:background="#drawable/location_button"
android:layout_alignParentTop="true"
android:layout_toEndOf="#+id/imageButton"
android:layout_marginLeft="30dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/relativeLayout2"
android:layout_alignParentStart="true"
android:layout_marginTop="12dp"
android:id="#+id/relativeLayout3">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="“Live each day as if your life had just begun.” "
android:id="#+id/txt_status"
android:textColor="#ffd9162d"
android:textSize="12dp"
android:textStyle="italic"
android:gravity="center"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/relativeLayout3"
android:layout_alignParentStart="true">
<TextView
android:text="Birthday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView3"
android:textSize="12sp"
android:layout_marginStart="75dp"
android:layout_marginTop="23dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:textColor="#000" />
<TextView
android:text="19 MAR 1992"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView4"
android:inputType="date"
android:layout_marginEnd="79dp"
android:textSize="12sp"
android:layout_alignBaseline="#+id/textView3"
android:layout_alignBottom="#+id/textView3"
android:layout_alignParentEnd="true" />
<TextView
android:text="Profession"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView5"
android:layout_below="#+id/textView3"
android:layout_alignStart="#+id/textView3"
android:layout_marginTop="20dp"
android:textColor="#000"
android:textSize="12sp" />
<TextView
android:text="Software Engineer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView6"
android:textSize="12sp"
android:maxWidth="20dp"
android:layout_alignTop="#+id/textView5"
android:layout_alignStart="#+id/textView4"
android:layout_alignEnd="#+id/textView4" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true">
<TextView
android:text="dgsdfsdfdfsdfsdfvv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView8"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
<TextView
android:text="dgsdfsdfdfsdfsdfvv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView11"
android:layout_below="#+id/textView8"
android:layout_alignParentStart="true" />
<TextView
android:text="dgsdfsdfdfsdfsdfvv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView9"
android:layout_below="#+id/textView11"
android:layout_alignParentStart="true" />
<TextView
android:text="dgsdfsdfdfsdfsdfvv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView10"
android:layout_below="#+id/textView9"
android:layout_alignParentStart="true" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
// This is the imageview which overlay the first LinearLayout
<ImageView
android:layout_width="122dp"
android:layout_height="122dp"
android:src="#drawable/circle_profile_pic"
android:adjustViewBounds="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="100dp"
android:background="#drawable/stroke"/>

Floating Action Button not working over ListView

I have a floating action button over a listview, but I can't click on the button when the list fills up so that the button and the list overlap. In that situation only the list item is clickable. How do I rectify this issue? Thanks in advance. My xml code is below.
<?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="wrap_content">
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
card_view:cardCornerRadius="1dp"
card_view:cardElevation="5dp">
<RelativeLayout
android:id="#+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/frameLayout"
android:layout_centerHorizontal="true"
android:layout_gravity="bottom"
android:background="#000000"
android:orientation="vertical"
android:padding="1.5dp"
android:weightSum="1">
<TextView
android:id="#+id/txtTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#660033"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/primary_text_dark" />
<RelativeLayout
android:id="#+id/frameLayout"
android:layout_width="fill_parent"
android:layout_height="300dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="29dp"
android:background="#android:color/darker_gray"
android:padding="2dp">
<TextView
android:id="#+id/txtLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="#+id/dispLoc"
android:layout_gravity="left|top"
android:text="[Location]"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/txtDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="#+id/dispDesc"
android:layout_gravity="left|center_vertical"
android:layout_marginTop="1dp"
android:text="[Description]"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/dispLoc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="#string/loc"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/dispDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="#+id/txtLocation"
android:layout_gravity="left|center_vertical"
android:layout_marginTop="17dp"
android:text="#string/desc"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/dispContact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="#+id/txtDesc"
android:layout_marginTop="25dp"
android:text="#string/contact"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/txtContact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/dispContact"
android:layout_toEndOf="#+id/dispLoc"
android:autoLink="email"
android:text="[ContactInfo]"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/From"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="#+id/dispContact"
android:layout_marginTop="16dp"
android:text="#string/from"
android:textColor="#android:color/primary_text_light" />
<TextView
android:id="#+id/txtStartDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/From"
android:layout_marginLeft="10dp"
android:layout_toEndOf="#+id/From"
android:text="[Start Date]"
android:textColor="#android:color/secondary_text_light" />
<TextView
android:id="#+id/To"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="#+id/txtStartDate"
android:text="#string/to"
android:textColor="#android:color/primary_text_light" />
<TextView
android:id="#+id/txtEndDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/txtStartDate"
android:layout_alignTop="#+id/To"
android:text="[End Date]"
android:textColor="#android:color/secondary_text_light" />
<Button
android:id="#+id/attend_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:text="Attend" />
<Button
android:id="#+id/cancel_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignStart="#+id/txtContact"
android:text="Cancel" />
</RelativeLayout>
<TextView
android:id="#+id/txtType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/txtTitle"
android:layout_alignEnd="#+id/txtTitle"
android:text="Type"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/primary_text_dark" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<TextView
android:id="#+id/peopleAttending"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/card_view"
android:background="#660033"
android:text="#string/people_attending"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/primary_text_dark" />
<org.lucasr.twowayview.TwoWayView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/lvItems"
style="#style/TwoWayView"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_below="#+id/peopleAttending"
android:drawSelectorOnTop="false"
tools:context=".DetailedEventActivity" />
<com.software.shell.fab.ActionButton xmlns:fab="http://schemas.android.com/apk/res-auto"
android:id="#+id/action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="#dimen/fab_margin"
android:layout_marginEnd="#dimen/fab_margin"
fab:button_color="#color/fab_material_red_500"
fab:button_colorPressed="#color/fab_material_red_900"
fab:hide_animation="#anim/fab_roll_to_down"
fab:image="#drawable/fab_plus_icon"
fab:image_size="24dp"
fab:shadow_color="#757575"
fab:shadow_radius="1.0dp"
fab:shadow_xOffset="0.5dp"
fab:shadow_yOffset="1.0dp"
fab:show_animation="#anim/fab_roll_from_down"
fab:stroke_color="#color/fab_material_blue_grey_500"
fab:stroke_width="1.0dp"
fab:type="DEFAULT"
android:clickable="true"/>
<ListView
android:id="#+id/commentsList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/lvItems"
android:layout_marginTop="0dp"
/>
Move your FAB to the bottom of the XML (below the ListView).

Categories

Resources