Thursday, 15 September 2011

android - AutoCompleteTextView dropdown style ignored -


itemprop = "text">

madness ... no matter what I try to do, my AutoCompleteTextView show is the default style below Drop items with I can not do anyhow to see the hanging scene - I've tried styling in XML that it is coding up in my adapter as well as AutoCompleteTextView only coding above

spinner_dropdown_item.xml:

  & lt; TextView xmlns: Android = "http://schemas.android.com/apk/res/android" Android: paddingLeft = "10dp" Android: paddingRight = "10dp" Android: paddingTop = "15dp" Android: paddingBottom = "15dp" Android: layout_width = "fill_parent" android: layout_height = "wrap_content" android: textcolor = "# 000" Android: textSize = "16dp" />   

My clients ( LoginFragment.java ):

  AutoCompleteTextView user_name = (AutoCompleteTextView) layout.findViewById (R.id. User name); Last MyAdapter & lt; Users & gt; Adapter = New MyAdapter & lt; Users & gt; (My_activity, my_list); // does not adapter anything. Setdropdown View Resource (R.layout.spinner_dropdown_item); // Application crash with no errors or nothing! User_name.setDropDownBackgroundResource (R.layout.spinner_dropdown_item); User_name.setAdapter (user_adapter); In the end, my adapter, which is working perfectly for any drop-down item for the spinner, but in the drop-down style for AutoCompleteTextView, fails in:  
  @ override public view getDropDownView (integer status, seeviewview, ViewGroup parent) {TextView TV; If (convertView == faucet) {layoutInfleter inflater = LayoutInflater.from (reference); Tv = (TextView) inflater.inflate (R.Let.spinner_dropdown_item, empty); } Else {tv = (TextView) Convertview; } T object = objects.get (position); String label = NULL_ITEM; If (object! = Null) {label = object.toString (); } Tv.setText (label); Return TV; }   

The dropdown text item is styled in any way, such as how can I change the drop down list in an AutoCompleteTextView? I think the problem was that my adapter class needed to get the desired layout in its constructor. Why can no IDEA refer to the desired layout in the adapter

No comments:

Post a Comment