当我尝试这个时- 它不起作用。为什么?这是我的代码:
ListView list = (ListView) findViewById(R.id.workers_list);
View headersView = getLayoutInflater().inflate(R.layout.listview_row, null);
HashMap<String, String> map = createWorkerHashMap(workerTypes.WORKER, "Імена", "Прізвище", "Стаж", "Дата народження", "Місце роботи", "Наукова ступінь", "Вчене звання", "Розряд");
list.addHeaderView(headersView, (Object) map, false);
List<> workersArrayList = new ArrayList<HashMap<String, String>>();
SimpleAdapter workersListAdapter = new SimpleAdapter(this, workersArrayList, R.layout.listview_row,
new String[] {"first_name", "last_name", "experience", "birthday", "job", "academic_degree", "academic_title", "operative_rank"}, new int[] {R.id.first_name, R.id.last_name, R.id.experience, R.id.birthday, R.id.job, R.id.academic_degree, R.id.academic_title, R.id.operative_rank});
list.setAdapter(workersListAdapter);