2016-03-23 8 views
0

Also mache ich ein kleines Projekt, wo ich eine Autocomplete-Box für die Eingabe einiger Waren ein für eine Einkaufsliste benötigen. Ich habe jedoch einige Probleme, da die Dropdown-Box nicht die unteren Ränder des linearen Layouts respektiert. Jede Hilfe wird sehr geschätzt.Android View ist nicht übergeordnete Layout-Polsterung

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/linearLayoutShoppingList" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

<include 
    android:id="@+id/toolbar" 
    layout="@layout/toolbar" /> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin"> 


    <RelativeLayout 
     android:id="@+id/dropDownAnchor" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <com.printz.guano.shoppingassistant.DefaultTopAutoCompleteTextView 
      android:id="@+id/autoCompleteAddWare" 
      android:layout_width="match_parent" 
      android:layout_height="50dp" 
      android:dropDownAnchor="@id/dropDownAnchor" 
      android:dropDownWidth="wrap_content" 
      android:hint="@string/add_ware_hint" 
      android:imeOptions="actionSend" 
      android:inputType="textCapSentences" 
      android:paddingLeft="10dp" 
      android:paddingRight="10dp" 
      android:textColor="@color/colorPrimaryText" 
      android:textSize="@dimen/editTextSize" /> 

     <Button 
      android:id="@+id/buttonCloseDropDown" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_centerVertical="true" 
      android:background="@color/colorPrimaryDark" 
      android:contentDescription="@string/add_ware_description" 
      android:text="Close" 
      android:textColor="@color/colorToolbarSecondayText" 
      android:textSize="20sp" 
      android:visibility="gone" /> 
    </RelativeLayout> 

    <ListView 
     android:id="@+id/listViewWares" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_marginTop="2dp" /> 
</LinearLayout> 

The autocomplete view

Antwort

0

Von dem, was ich sehen kann, können Sie dieses Problem lösen, indem android:paddingBottom="?dp" innerhalb der LinearLayout Einsetzen oder android:marginBottom="?dp" innerhalb der ListView einlegen.

ersetzen ? mit einer Reihe

+0

Das machte keinen Unterschied. Ich habe versucht, die listview-Funktion mit bottom padding zu ergänzen, und nichts hat sich geändert, das lineare Layout hat bereits eine Auffüllung – guano