How to remove ListView's add item animation?

后端 未结 7 2224
攒了一身酷
攒了一身酷 2021-02-14 06:26

I have a ListView and I edited its ItemContainerStyle to modify some style but I don\'t know how to remove that annoying animation when you add an item

7条回答
  •  清歌不尽
    2021-02-14 06:47

    In UWP, I created the following code to remove the animation:

    // Remove Add/Delete animations
    TransitionCollection tc = _listView.ItemContainerTransitions;
    for (int i = tc.Count - 1; i >= 0; i--) if (tc[i] is AddDeleteThemeTransition) tc.RemoveAt(i);
    

提交回复
热议问题