【发布时间】:2016-09-24 20:55:30
【问题描述】:
我编辑了一个 ScrollViewer 的模板,在隐藏滚动条之前只等待 0.5 秒,这在当时成功地隐藏了它们,但它们又重新出现了 0.5 秒。为什么?
要重现,请使用默认模板 (find it here on MSDN) 为 ScrollViewer 的样式创建页面资源,并将“3”的 3 次出现更改为“0.5”。然后使用以下 XAML:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<ScrollViewer Height="500" Width="500" Style="{StaticResource ScrollViewerControlTemplate1}">
<Grid Background="Blue" Height="1000" Width="1000">
</Grid>
</ScrollViewer>
</Grid>
将光标移到 ScrollViewer 上以显示滚动条。让光标静止 0.5 秒以查看滚动条消失。然后再出现 0.5 秒。为什么?
【问题讨论】:
-
检查
Style="{StaticResource ScrollViewerControlTemplate1}"视觉状态和动画 -
@Stamos 我想我不够清楚 -
ScrollViewerControlTemplate1是我编辑的模板 -
在问题的最后两行,您描述了 99% 与该模板的视觉状态/动画有关的内容。能否请您编辑您的问题并添加模板 xaml?;
-
@Stamos 关注问题中的链接 (-MSDN)。
-
您必须至少将
KeyTime设置为1.1s。
标签: xaml windows-store-apps win-universal-app uwp uwp-xaml