當想讓Listview元件被touch時不會有任何焦點(touch失效)和highlight的產生,很簡單~ 只要Override areAllItemsEnabled and isEnabled 函數即可降Listview元件就不能被touch了,只做顯示的功能。
ArrayList<HashMap<String, String>> ListItem = new ArrayList<HashMap<String, String>>();
SimpleAdapter listItemAdapter = new SimpleAdapter(this,ListItem,R.layout.detail_list,
new String[] { "Title", "Information" },new int[] { R.id.Title, R.id.Information})
{
@Override
public boolean areAllItemsEnabled()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isEnabled(int position)
{
// TODO Auto-generated method stub
return false;
}
};
沒有留言:
張貼留言