3 回答

TA貢獻(xiàn)1773條經(jīng)驗 獲得超3個贊
更好的是,您無需為列表單元格視圖創(chuàng)建單獨的android xml布局。如果列表僅包含textview,則可以只使用“ android.R.layout.simple_list_item_1”。
private class ExampleAdapter extends ArrayAdapter<String>{
public ExampleAdapter(Context context, int textViewResourceId, String[] objects) {
super(context, textViewResourceId, objects);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
TextView tv = (TextView) view.findViewById(android.R.id.text1);
tv.setTextColor(0);
return view;
}
- 3 回答
- 0 關(guān)注
- 733 瀏覽
添加回答
舉報