2010-09-18 46 views

回答

0

你需要實現

public int getSectionForPosition(int position) { 
return <return position where header start> 
} 

如果您正在使用AlphaIndexer,你可以簡單地使用

public int getSectionForPosition(int position) { 
return alphaIndexer.getSectionForPosition(position); 
} 

希望有所幫助。

1

看到這裏的AmazingListView,這是ListView的第頭部。

它的工作原理爲默認的聯繫人應用程序類似。

http://code.google.com/p/android-amazing-listview/

+0

感謝您的指針。這有幫助。我讓它爲我的項目工作,但我想隱藏第一行的標題。我可以通過在'bindSectionHeader'寫'view.findViewById(R.id.header).setBackgroundColor(Color.RED)'改變顏色,但不能掩蓋與'view.findViewById(R.id.header)頭.setVisibility (View.GONE);'有什麼幫助? :( – Sufian 2013-05-01 11:18:27

+0

一個有趣的事情是,在執行'view.findViewById(R.id.header).setVisibility(View.GONE)'這一行後,標題並沒有佔用空間,但仍然可見,仍然需要一些幫助。 – Sufian 2013-05-01 11:34:22

+0

我解決了我的問題,如下所述:http://stackoverflow.com/a/17164132/1276636 – Sufian 2013-10-31 07:54:43

相關問題