Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
問題は次のとおりです。リストビューでは、listViewの子は画面に表示される要素ですか?
つまり、キーボードがポップしてリストの子をトレースし、リストの最後の要素に到達しようとするたびに試みますが、到達できません。子供たちをなぞる前に一番下まで行ってもcurrentListView.setSelection(currentListView.getCount());
currentListView.setSelection(currentListView.getCount());
説明を探しているだけです、ありがとう。
currentListView.setSelection(currentListView.getCount()-1);リストのインデックスは 0 から始まるため、最後の要素を で呼び出します。
currentListView.setSelection(currentListView.getCount()-1);
たとえば、リストに 3 つの要素がある場合、0|1|2 のように番号が付けられます。コールgetCount()すると 3 になるので、アウト オブ バウンズです。
getCount()