考慮到我有以下AutoCompleteTextViews如何爲多個AutoCompleteTextView設置相同的屬性?
ArrayAdapter<String> adapter121 = new ArrayAdapter<String>
(this,android.R.layout.simple_dropdown_item_1line,androidBooks);
AutoCompleteTextView acTextView = (AutoCompleteTextView)findViewById(R.id.AndroidBooks);
AutoCompleteTextView acTextView0 = (AutoCompleteTextView)findViewById(R.id.AndroidBooks1);
AutoCompleteTextView acTextView1 = (AutoCompleteTextView)findViewById(R.id.et3);
AutoCompleteTextView acTextView2 = (AutoCompleteTextView)findViewById(R.id.et4);
AutoCompleteTextView acTextView3 = (AutoCompleteTextView)findViewById(R.id.et5);
AutoCompleteTextView acTextView4 = (AutoCompleteTextView)findViewById(R.id.et6);
AutoCompleteTextView acTextView5 = (AutoCompleteTextView)findViewById(R.id.et7);
AutoCompleteTextView acTextView6 = (AutoCompleteTextView)findViewById(R.id.et8);
AutoCompleteTextView acTextView7 = (AutoCompleteTextView)findViewById(R.id.et9);
我怎麼會叫:
acTextView.setThreshold(1);
acTextView.setAdapter(adapter121);
每個我AutoCompleteTextViews的?
什麼? ?........ – codeMagic 2014-09-19 18:27:39
acTextView0和acTextView1以及acTextView2如何在代碼中啓動,就像acTextView.setThreshold(1); acTextView.setAdapter(adapter121); – 2014-09-19 18:29:18
用您的實際問題更新您的文章。簡單地發佈代碼並不是一個有效的問題。 – codeMagic 2014-09-19 18:29:57