gpt4 book ai didi

windows-phone-8.1 - 将项目添加到 ListView 时如何禁用动画

转载 作者:行者123 更新时间:2023-12-04 07:45:48 24 4
gpt4 key购买 nike

如何在向 ListView 添加新项目时禁用动画?

How to set animations/transitions when adding elements to a ListViews?

我试过这个例子,但它没有为我的列表显示任何列表页脚。

我试过这样做:

    <ListView>
<ListView.ItemContainerTransitions>
<ContentThemeTransition /> <!-- omit AddDeleteThemeTransition -->

</ListView.ItemContainerTransitions>
</ListView>

但这并没有运行,当我启动应用程序时它崩溃了。

最佳答案

documentation for ItemsControl.ItemContainerTransitions property 中指出了这个怪癖:

Important The XAML syntax for properties that have a TransitionCollection value is unusual in that you must declare an explicit TransitionCollection object element as the value, and then provide object elements as child elements of TransitionCollection for each of the transition animations you want to use. For most other XAML collection properties you could omit the collection object element because it can be implicit, but TransitionCollection doesn't support the implicit collection usage.

试试这个 XAML:

<ListView>
<ListView.ItemContainerTransitions>
<TransitionCollection>
<ContentThemeTransition /> <!-- You can even omit this transition if desired -->
</TransitionCollection>
</ListView.ItemContainerTransitions>
</ListView>

关于windows-phone-8.1 - 将项目添加到 ListView 时如何禁用动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26726412/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com