How to solve blank space (Android)?

2

I have an Android XML that implements an AutoCompleteTextView. The thing is that I would like to put it underneath and if I move it, a blank space is generated between the top bar and the AutoCompleteTextView. Any solution?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:layout_marginTop="?attr/actionBarSize"
tools:context="sharetaxi.sharetaxiuser.Map"
tools:showIn="@layout/app_bar_main"
android:orientation="vertical">

<AutoCompleteTextView
    android:id="@+id/query"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="10dp"
    android:paddingRight="10dp"
    android:paddingBottom="10dp" />

<com.mapbox.mapboxsdk.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"/>

    
asked by moraa 25.04.2018 в 16:30
source

1 answer

2

The problem is that you are defining in the container a:

android:layout_marginTop="?attr/actionBarSize"

This is generating a margin with the size of the ActionBar.

Remove this property from your% main% co, to remove the blank space that you comment.

This is currently displayed:

This would show up eliminating the property:

    
answered by 25.04.2018 / 16:52
source