AutoCompleteTextView Misplacement? [SOLVED]

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

AutoCompleteTextView Misplacement? [SOLVED]

Postby Carl Simmons » Mon Feb 15, 2010 6:35 pm

Hey guys, I have an AutoCompleteTextView in my application, it works fine and on a HVGA screen, you would not know there was anything wrong. However, when I emulate it on a QVGA screen, the AutoCompleteTextView Dropdown is misplaced and put above the typing field, making it basically impossible to click or explore.

I'm new to this stuff and would just be shooting in the dark, so some help would be much appreciated :) below is some snippets of my code.


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5.  
  6.    android:layout_width="fill_parent"
  7.  
  8.    android:layout_height="fill_parent">
  9.  
  10.     >
  11.  
  12.     <TextView  
  13.  
  14.         android:id="@+id/instructName"
  15.  
  16.        android:layout_width="fill_parent"
  17.  
  18.        android:layout_height="wrap_content"
  19.  
  20.        android:text="Enter the name of recipient"
  21.  
  22.        />    
  23.  
  24.     <AutoCompleteTextView
  25.  
  26.         android:id="@+id/PhoneNo"
  27.  
  28.         android:layout_below="@id/instructName"
  29.  
  30.        android:layout_width="fill_parent"
  31.  
  32.        android:layout_height="wrap_content"
  33.  
  34.        />
  35.  
  36. </RelativeLayout>
  37.  
  38.  
Parsed in 0.002 seconds, using GeSHi 1.0.8.4



Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. ContentResolver content = getContentResolver();
  3.  
  4.                 Cursor peopleQuery = content.query(Contacts.People.CONTENT_URI,
  5.  
  6.                                 PEOPLE_PROJECTION, null, null,
  7.  
  8.                                 Contacts.People.DEFAULT_SORT_ORDER);
  9.  
  10.                 AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.PhoneNo);
  11.  
  12.                 ContactListAdapter adapter = new ContactListAdapter(this, peopleQuery);
  13.  
  14.                 textView.setAdapter(adapter);
  15.  
  16.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


I think I must be missing something in the xml layout settings, but no idea what >.<
Last edited by Carl Simmons on Wed Feb 17, 2010 10:23 am, edited 1 time in total.
Carl Simmons
Freshman
Freshman
 
Posts: 5
Joined: Sun Feb 14, 2010 5:27 pm

Top

Postby Carl Simmons » Wed Feb 17, 2010 10:23 am

Fixed this by adding a dropDownHeight as shown below

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2.     <AutoCompleteTextView
  3.  
  4.         android:id="@+id/txtPhoneNo"
  5.  
  6.         android:layout_below="@id/instructName"
  7.  
  8.        android:layout_width="fill_parent"
  9.  
  10.        android:layout_height="wrap_content"
  11.  
  12.        android:dropDownHeight="fill_parent"
  13.  
  14.        />
  15.  
  16.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Although it looks like it has a slight bug when you make a selection in a QVGA emulator, it doesn't show on an actual platform, and works fine on both a HVGA and QVGA screen
Carl Simmons
Freshman
Freshman
 
Posts: 5
Joined: Sun Feb 14, 2010 5:27 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests