Thanks in advance for anyone that can help.  I'm trying to use the
AutoCompleteTextView - it works just fine as far as matching text,
however I'm getting an interesting problem as my choices are narrowed
down.  The box is docked to the bottom of the screen.  When you being
entering text, the list of items displays just above the box as
expected, however once the terms get narrowed down (say from 7 to 3),
the top of the list of remaining terms is docked to the top of where
the original list of seven items were.  Instead, the bottom of the
list should align to the top of the search box.

Here is the layout for my search form - there is a search box on the
bottom of the screen with a ListView above it (search_list.xml):

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                        android:gravity="bottom" >

     <ListView android:id="@+id/search_lv"
                android:layout_width="fill_parent"
                android:layout_height="340px" />

         <ImageView android:layout_width="fill_parent"
                      android:layout_height="55px"
                      android:layout_alignParentBottom="true"
                      android:background="@drawable/ga_light_grey"/>

         <TextView android:id="@+id/search_label"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_alignParentBottom="true"
                      android:paddingBottom="16px"
                      android:paddingLeft="5px"
                      android:paddingRight="5px"
                      android:textColor="@drawable/black"
                      android:text="@string/find"  />

            <AutoCompleteTextView android:id="@+id/search_field"
                      android:layout_height="wrap_content"
                      android:layout_width="wrap_content"
                      android:layout_toRightOf="@+id/search_label"
                      android:layout_alignParentRight="true"
                      android:layout_alignParentBottom="true"
                      android:completionThreshold="1"
                      android:selectAllOnFocus="true"
                      android:singleLine="true"
                      android:textSize="18px"
                      android:paddingRight="5px"
                      android:hint="@string/search"
                      android:textColor="@drawable/black"  />

</RelativeLayout>

I am using a custom object for each auto complete item
(dropdown_item.xml):

<?xml version="1.0" encoding="UTF-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android";
    android:id="@android:id/text1"
    style="?android:attr/dropDownItemStyle"
    android:textAppearance="?android:attr/textAppearanceLargeInverse"
    android:singleLine="true"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:textColor="@drawable/black"
    android:background="@drawable/ga_light_grey" />

Here is the java that's used to populate the AutoComplete object:

ArrayAdapter<String> acAdapter = new ArrayAdapter<String>(this,
                R.layout.dropdown_item, <some String[]>);
((AutoCompleteTextView)findViewById(R.id.search_field)).setAdapter
(acAdapter);

Thanks again!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to