假设我使用典型方法将标题视图添加到列表视图中,如下所示:
View header = getLayoutInflater().inflate(R.layout.list_header, null);
TextView headerText = (TextView) header.findViewById(R.id.my_textview);
headerText.setText("This is my header!");
myListView.addHeaderView(header);
myListView.setAdapter(adapter);
然后,我需要更改标题textview的文本...
TextView headerText = (TextView) findViewById(R.id.my_textview);
headerText.setText("new header text!");
这似乎不起作用,因为我最初将标题附加到列表的方式是通过膨胀它...
如何更改文字?