打开一个listview的时候能够自动设置显示的位置, setSelection(int pos)可以设置显示的位置。
但是使用的时候大家会发现有时候起作用,有时候不起。
原因:
public void setSelection (int position)
Added in API level 1
Sets the currently selected item. If in touch mode, the item will not be selected but it will still be positioned appropriately. If the specified selection position is less than 0, then the item at position 0 will be selected.
touch mode的时候不起作用
touch mode指啥:从英文单词上来说,就是在触摸状态,下面一段具体的解释