我已经开始使用nhaarman ListViewAnimations library并面临以下问题:在ListView项目被解雇后,下一个项目会更改其高度:
@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));
}
}
}
);
}
发生了什么事?