ListView 中的 setSelection()

来源:互联网 发布:逆战透视源码 编辑:程序博客网 时间:2024/06/16 04:48
    /**     * 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.     *     * @param position Index (starting at 0) of the data item to be selected.     */    @Override    public void setSelection(int position) {        setSelectionFromTop(position, 0);    }

设置当前选中的项。
如果在触摸模式下,该项目将不会被选中,但它仍将被适当地定位。
如果指定的选择位置小于0,则将选择位置0的项。

原创粉丝点击