【发布时间】:2015-06-13 23:52:42
【问题描述】:
在我的 Activity 中,我在这里通过某人的帖子创建了一个 listView。
每个 listView 的 row 都包含 TextView 和 Button。
在某些情况下,我想在运行时制作几行按钮不可见,但我不明白怎么做。
for (int listIndex = 0; listIndex < booksNamesList.size(); ++listIndex) {
// get the book name from the list and add it to the listAdapter
String strBookName = booksNamesList.get(listIndex).getBookText().toString();
m_listAdapter.add(strExperience);
// TODO:
// if *anyCondition*, disable the button for the listIndex row.
}
m_listView.setAdapter( m_listAdapter );
注意:m_listView 是 ListView 的对象,m_listAdapter 是 ArrayAdapter 的对象。
请帮忙,谢谢!
【问题讨论】:
标签: listview button android-activity android-studio android-arrayadapter