I'm putting together a layout and the layout is not occupying the entire screen. I have tried it in many ways, but it is never possible for it to occupy, so everything I need is not fit.
Problem happens when placing the scrollview, is it possible to have the whole screen with it?
Follow XML:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
android:id="@+id/relative_rota">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_alignParentTop="true"
android:layout_marginBottom="15dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="0dp"
android:layout_marginStart="@dimen/txt_left_margin"
android:layout_marginTop="@dimen/first_view_top_margin"
android:fontFamily="sans-serif-condensed"
android:text="@string/ondeEstou"
android:textColor="@color/txt_text"
android:textStyle="bold" />
<AutoCompleteTextView
android:id="@+id/rota_edt_origem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginEnd="@dimen/edt_right_margin"
android:layout_marginStart="@dimen/edt_left_margin"
android:layout_marginTop="@dimen/edt_top_margin"
android:fontFamily="sans-serif-condensed"
android:hint="@string/action_my_location"
android:inputType="textCapCharacters"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/edt_text"
android:textColorHint="@color/edt_text"
android:textSize="@dimen/edt_text_size" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/txt_left_margin"
android:fontFamily="sans-serif-condensed"
android:text="@string/destino"
android:textColor="@color/txt_text"
android:textStyle="bold" />
<AutoCompleteTextView
android:id="@+id/rota_edt_destino"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/edt_right_margin"
android:layout_marginStart="@dimen/edt_left_margin"
android:layout_marginTop="@dimen/edt_top_margin"
android:fontFamily="sans-serif-condensed"
android:inputType="textCapCharacters"
android:hint="@string/action_type_destination"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/edt_text"
android:textColorHint="@color/edt_text"
android:textSize="@dimen/edt_text_size"
android:layout_marginBottom="7dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/txt_left_margin"
android:fontFamily="sans-serif-condensed"
android:text="@string/companhia"
android:textColor="@color/txt_text"
android:textStyle="bold" />
<EditText
android:id="@+id/rota_edt_companhia"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginEnd="@dimen/edt_right_margin"
android:layout_marginStart="@dimen/edt_left_margin"
android:layout_marginTop="@dimen/edt_top_margin"
android:fontFamily="sans-serif-condensed"
android:inputType="none"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/edt_text"
android:textIsSelectable="true"
android:textSize="@dimen/edt_text_size" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:completionThreshold="3"
android:src="@drawable/powered_by_google_light"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:layout_alignParentStart="true"
android:layout_marginTop="124dp">
<ImageButton
android:id="@+id/trasporte_a_pe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:contentDescription="@string/place_autocomplete_search_hint"
android:onClick="chamarRota"
android:padding="@dimen/place_autocomplete_button_padding"
android:src="@drawable/ic_transp_walk_white_48px" />
<ImageButton
android:id="@+id/trasporte_bike"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:contentDescription="@string/place_autocomplete_search_hint"
android:onClick="chamarRota"
android:padding="@dimen/place_autocomplete_button_padding"
android:src="@drawable/ic_transp_bike_white_48px" />
<ImageButton
android:id="@+id/trasporte_carro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:contentDescription="@string/place_autocomplete_search_hint"
android:onClick="chamarRota"
android:padding="@dimen/place_autocomplete_button_padding"
android:src="@drawable/ic_transp_car_white_48px" />
<ImageButton
android:id="@+id/trasporte_publico"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:contentDescription="@string/place_autocomplete_search_hint"
android:onClick="chamarRota"
android:padding="@dimen/place_autocomplete_button_padding"
android:src="@drawable/ic_transp_bus_white_48px" />
</LinearLayout>
</RelativeLayout>
Follow the picture as it is:
Ineedyoutofilltheentirescreen,soit'swelldistributed.Onlyvertically.
Thanksforthehelp!
-EDIT-XMLchanged,butwhenIputthescrollview,soitispossibletoscrollthescreenwiththekeyboardopen,itlimitsmetotheonemarkedintheimage.
<?xmlversion="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/relative_rota"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/fundo_3"
android:padding="10dp"
tools:context="app.Rota">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_below="@+id/layout_top"
android:layout_gravity="end"
android:completionThreshold="3"
android:src="@drawable/powered_by_google_light" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="115dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageButton
android:id="@+id/trasporte_a_pe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@color/fundo_3"
android:contentDescription="@string/place_autocomplete_search_hint"
android:onClick="chamarRota"
android:padding="@dimen/place_autocomplete_button_padding"
android:src="@drawable/ic_transp_walk_white_48px" />
<ImageButton
android:id="@+id/trasporte_bike"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@color/fundo_3"
android:contentDescription="@string/place_autocomplete_search_hint"
android:onClick="chamarRota"
android:padding="@dimen/place_autocomplete_button_padding"
android:src="@drawable/ic_transp_bike_white_48px" />
<ImageButton
android:id="@+id/trasporte_carro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@color/fundo_3"
android:contentDescription="@string/place_autocomplete_search_hint"
android:onClick="chamarRota"
android:padding="@dimen/place_autocomplete_button_padding"
android:src="@drawable/ic_transp_car_white_48px" />
<ImageButton
android:id="@+id/trasporte_publico"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@color/fundo_3"
android:contentDescription="@string/place_autocomplete_search_hint"
android:onClick="chamarRota"
android:padding="@dimen/place_autocomplete_button_padding"
android:src="@drawable/ic_transp_bus_white_48px" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="80dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="0dp"
android:layout_marginStart="@dimen/txt_left_margin"
android:layout_marginTop="@dimen/first_view_top_margin"
android:fontFamily="sans-serif-condensed"
android:text="@string/ondeEstou"
android:textColor="@color/txt_text"
android:textStyle="bold" />
<AutoCompleteTextView
android:id="@+id/rota_edt_origem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginEnd="@dimen/edt_right_margin"
android:layout_marginStart="@dimen/edt_left_margin"
android:layout_marginTop="@dimen/edt_top_margin"
android:fontFamily="sans-serif-condensed"
android:hint="@string/action_my_location"
android:inputType="textCapCharacters"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/edt_text"
android:textColorHint="@color/edt_text"
android:textSize="@dimen/edt_text_size" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/txt_left_margin"
android:fontFamily="sans-serif-condensed"
android:text="@string/destino"
android:textColor="@color/txt_text"
android:textStyle="bold" />
<AutoCompleteTextView
android:id="@+id/rota_edt_destino"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginEnd="@dimen/edt_right_margin"
android:layout_marginStart="@dimen/edt_left_margin"
android:layout_marginTop="@dimen/edt_top_margin"
android:fontFamily="sans-serif-condensed"
android:hint="@string/action_type_destination"
android:inputType="textCapCharacters"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/edt_text"
android:textColorHint="@color/edt_text"
android:textSize="@dimen/edt_text_size" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/txt_left_margin"
android:fontFamily="sans-serif-condensed"
android:text="@string/companhia"
android:textColor="@color/txt_text"
android:textStyle="bold" />
<EditText
android:id="@+id/rota_edt_companhia"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginEnd="@dimen/edt_right_margin"
android:layout_marginStart="@dimen/edt_left_margin"
android:layout_marginTop="@dimen/edt_top_margin"
android:fontFamily="sans-serif-condensed"
android:inputType="none"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/edt_text"
android:textIsSelectable="true"
android:textSize="@dimen/edt_text_size" />
</LinearLayout>
</RelativeLayout>