2017-06-13 72 views
-1

是否有人知道如何更改AutoCompleteTextView行的大小? 我需要黑线在边缘更长。 这是我的XML代码:如何更改AutoCompleteTextView行的大小?

<AutoCompleteTextView 
    android:id="@+id/autoComplete_text" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_margin="16dp" 
    android:hint="     Where you want to Go?" 
    android:layout_centerHorizontal="true" 
    android:textSize="20sp" 
    android:textColorHint="#0b0b0b" 
    android:imeOptions="actionSearch" 
    android:dropDownHeight="25dp" 
    /> 

回答

1
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_country); 
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), R.layout.list_item, R.id.item, COUNTRIES); 
    textView.setAdapter(adapter); 
+0

谢谢!它现在对我有用。 – ein

2

删除保证金那么它会占用全部宽度

或尽量减少

android:layout_margin="16dp" 
+0

谢谢!它现在对我有用:) – ein