我有一个stackFromBottom ListView
,如何在设置适配器后设置listView的位置
runOnUiThread(new Runnable() {
@Override
public void run() {
list.setAdapter(adapter);
list.post(new Runnable() {
@Override
public void run() {
list.requestFocusFromTouch();
list.setSelection(10);
list.requestFocus();
}
});
}
});
答案 0 :(得分:1)
好的,我找到了答案:
list.postDelayed(new Runnable() {
@Override
public void run() {
list.setSelectionFromTop(3,20);
}
}, 500);