MultiLineChoose icon indicating copy to clipboard operation
MultiLineChoose copied to clipboard

关于多选的初始值设置

Open yanxiaoguang opened this issue 5 years ago • 0 comments

再设置多选的初始值时,我调用了这个方法,发现有些不正常,反编译看到方法是

public void setIndexListItemSelected(List<Integer> positionList) {
        if (positionList != null && !positionList.isEmpty() && positionList.size() != 0) {
            int count = this.getChildCount();
            if (positionList.size() <= count) {
                for(int i = 0; i < positionList.size(); ++i) {
                    MultiLineChooseLayout.ItemView tagView = this.getIndexItem(i);
                    tagView.setItemSelected(true);
                }
            }
        }
 }

为什么用 this.getIndexItem(i); 而不是 this.getIndexItem(positionList.get(i));

yanxiaoguang avatar Sep 11 '20 01:09 yanxiaoguang