我正在使用swipelistview
库,但我想要的是一次只打开一个项目,
我有办法做到这一点,还是我必须想出一个工作场所?
答案 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);