问题描述
在WP 8.1,我怎么删除 ListView控件默认的动画
当一个项目被窃听,它的倾斜/取决于那里的自来水发生翻译成不同的方向?我想任何项目单击动画。
In WP 8.1, how do I remove the default animation in ListView
when an item is tapped and it's skewed/translated in different directions depending on where the tap occurs? I want no item click animation.
推荐答案
动画来自ListView的ItemContainerStyle的pressed状态。
The animation comes from the ListView's ItemContainerStyle's "Pressed" state.
在设计师选择的ListView,点击右键,选择编辑附加Templates.Edit生成的项容器(ItemContainerStyle).Edit副本...
In the designer select your ListView, right click, and choose "Edit Additional Templates.Edit Generated Item Container (ItemContainerStyle).Edit a copy..."
这将生成的TargetType =ListViewItem的风格:
This will generate a style with TargetType="ListViewItem":
<Style x:Key="ListViewItemStyle1" TargetType="ListViewItem">
在风格找到pressed视觉状态,并改变或删除动画:
In the style find the Visual State for "Pressed" and alter or remove the animation:
<VisualState x:Name="Pressed">
<Storyboard>
<!--<PointerDownThemeAnimation Storyboard.TargetName="TiltContainer"/>-->
</Storyboard>
</VisualState>
如果您要更换的动画,而不是仅仅取消则是混合编辑可视状态和动画的优秀工具。如果你支持点击或点击,那么你应该提供一些指示,这是怎么回事用户,但你可以在这里将其更改为你所需要的。根据需要,您还可以改变其他VisualStates。
If you want to replace the animation rather than just removing it then Blend is an excellent tool for editing Visual States and animations. If you're supporting clicking or tapping then you should provide some indication to the user what is going on, but you can change it here to what you need. You can also alter other VisualStates as needed.
这篇关于禁用自来水动画的ListView在WP 8.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!