我需要有一個ListView Indexable
,當我在一個數字click
重定向到的index
是相同的ListView Indexable
的數量。例如當我在click
上2時,它將我重定向到row
即index
(ListView
)的個數爲2。ListView可索引?
2
A
回答
1
試試這種方式,希望這會幫助你解決你的問題。
如果您不想更改IndexScroller類中的任何代碼,請在您的SimpleAdapter類中更改以下代碼。
右側部分值列表中沒有項目。
private String[] mSections;
public SimpleAdapter(ArrayList<String> mCurrentList, Context mContext) {
super();
this.mCurrentList = mCurrentList;
mSections = new String[mCurrentList.size()];
for(int i=0;i<mCurrentList.size();i++){
mSections[i] = String.valueOf(i+1);
}
this.mContext = mContext;
}
嘗試給出所選右側部分值以移動列表。
@Override
public int getPositionForSection(int section) {
return section;
}
+1
非常感謝。 ;) – 2014-10-30 08:56:55
+0
@ A.A,很高興幫助你.. – 2014-10-30 08:57:36
1
我看到IndexScroller.java
項目在onTouchEvent
評論這一行:
//mListView.setSelection(mIndexer.getPositionForSection(mCurrentSection));
然後加:
for (int i = 1; i < count; i++) {
if(mCurrentSection == i){
mListView.setSelection(mCurrentSection);
}
}
現在你可以工作。 ;) 這個例子是:
http://simpleandroidcoding.blogspot.in/2013/04/indexable-listview-tutorial-source-code.html
有了,你應該將號碼添加到indexable
然後找到Rows
基地IDS Rows
的差異。
相關問題
- 1. ListView項目索引
- 2. android - ListView的索引?
- 3. ListView選擇索引
- 4. QML ListView和ListModel索引
- 5. 發現的ListView列索引
- 6. ListView Windows 8多個索引
- 7. 如何檢查ListView中的頂部索引(索引0)?
- 8. 如何從ListView中獲取第一個可見項目/索引?
- 9. Android ListView:獲取可見項目的數據索引
- 10. Firemonkey ListView項索引不更新
- 11. 如何獲取listview的行索引?
- 12. ListView行ID和位置索引混淆
- 13. 獲取QList對象的ListView索引
- 14. 插入ListView項目的索引
- 15. ListView搜索引發NullPointer爲什麼getFilter()?
- 16. 在ListView控件中訪問GroupTemplate索引
- 17. ListView [VirtualMode]更改選定索引
- 18. 獲取listview選定的索引?
- 19. ListView插入項目的索引
- 20. 可可NSIndexSet:多重索引。如何創建索引集,多個索引?
- 21. 可可禁用TabItem索引
- 22. 可索引接口
- 23. 帶有複選框的可搜索ListView
- 24. Android的ListView - 檢索可見邊界
- 25. Android的listview搜索原因索引出界異常在片段
- 26. 索引,索引,索引
- 27. ListView引發NullPointerException
- 28. android - 搜索listview?
- 29. Android ListView搜索
- 30. PHP數組不可索引
檢查:http://simpleandroidcoding.blogspot.in/2013/04/indexable-listview-tutorial-source-code.html – 2014-10-30 06:48:24
沒有找到它的ListView基地第一個字符。我需要查找基礎(索引)的ListView。謝謝 – 2014-10-30 06:50:36
你可以使用索引而不是字母表。 – 2014-10-30 06:51:52