自动完成文本视图制作列表上升

时间:2014-12-18 14:51:44

标签: android autocompletetextview

我想让我的自动完整文字查看建议上升而不是下来我有这个布局,使其下降

  

simple_dropdown_item_1line

有没有可以让它上升的布局?

    AlertDialog.Builder alert = new AlertDialog.Builder(this);

    alert.setTitle("Sentence");
    alert.setMessage("type only words you taught him!!!");

    // Set an EditText view to get user input 
    //final EditText input = new EditText(this);
    //alert.setView(input);
    // Get a reference to the AutoCompletet in the layout
//  AttributeSet a =Resources.Theme.obtainStyledAttributes(a, playnum, cheight, cheight)  ;
    ArrayAdapter<String> adapter=new ArrayAdapter<>(this,android.R.layout.simple_dropdown_item_1line, mywordstring);
    final AutoCompleteTextView t =new AutoCompleteTextView(v.getContext());
    // Get the string array
    //String[] countries = getResources().getStringArray(R.array.countries_array);
    // Create the adapter and set it to the AutoCompletet 

    t.setAdapter(adapter);
    //adapter.notifyDataSetChanged();
    t.setThreshold(1);
    t.setDropDownHeight(cheight/2);
    //t.setDropDownWidth(cwidth/2);
    t.setDropDownBackgroundResource(R.drawable.abc_list_selector_background_transition_holo_dark);
    alert.setView(t);

由于某种原因,完成后不会出现在空格

之后

0 个答案:

没有答案