Android swipelistview只刷一个项目

时间:2013-11-14 16:45:25

标签: android

我正在使用swipelistview库,但我想要的是一次只打开一个项目,

我有办法做到这一点,还是我必须想出一个工作场所?

2 个答案:

答案 0 :(得分:1)

    mSwipeListView.setSwipeListViewListener(new com.example.swipelistview.BaseSwipeListViewListener() {
                    @Override
                    public void onOpened(int position, boolean toRight) {

                        for(int i=0;i<mSwipeListView.getChildCount();i++){
                          if(i!=position)
                                mSwipeListView.closeAnimate(i);

                        }

尝试这可能有用,我没有测试它

答案 1 :(得分:0)

您应在代码中使用以下内容:

listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);