Nhaarman ListViewAnimations:ListView项目高度在上一项解雇后更改

时间:2016-01-06 21:21:42

标签: android listview android-listview

我已经开始使用nhaarman ListViewAnimations library并面临以下问题:在ListView项目被解雇后,下一个项目会更改其高度:

Item before "444" was dismissed

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        dynamicListView = (DynamicListView) findViewById(R.id.listView);

        arrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, new ArrayList<> (Arrays.asList(new String[]{"111", "222", "333", "444", "555", "661", "277", "388", "499", "115", "221", "233", "443", "664", "5434"}))
        );
        dynamicListView.setAdapter(arrayAdapter);

        dynamicListView.enableSwipeToDismiss(
                new OnDismissCallback() {
                    @Override
                    public void onDismiss(@NonNull final ViewGroup listView, @NonNull final int[] reverseSortedPositions) {
                        for (int position : reverseSortedPositions) {
                            arrayAdapter.remove(arrayAdapter.getItem(position));
                        }
                    }
                }
        );
    } 

发生了什么事?

0 个答案:

没有答案