未找到 ScrollViewer CanContentScroll 属性(Windows 8.1 通用应用程序)
ScrollViewer CanContentScroll Property not Found (Windows 8.1 Universal App)
我正在尝试让 ScrollView 进行逻辑滚动而不是物理滚动。在网上阅读了如何执行此操作后,大多数消息来源都说将 CanContentScroll 属性 设置为 False。但是,当尝试这样做时,ScrollViewer 似乎没有这个 属性。
这是我的 XAML 代码:
<ScrollViewer x:Name="TestScroll" CanContentScroll="True" HorizontalScrollBarVisibility="Disabled" HorizontalScrollMode="Disabled" Margin="66,215,1020,10" Grid.Row="1">
<StackPanel x:Name="TestPanel" Orientation="Vertical">
</StackPanel>
</ScrollViewer>
抛出的错误:
Error 1 The member "CanContentScroll" is not recognized or is not accessible.
Error 2 The property 'CanContentScroll' was not found in type 'ScrollViewer'
我正在为 Windows 8.1 开发,创建一个通用应用程序。我觉得我缺少一些参考或一些非常简单的东西,因为我看过的其他地方,它都有效。
如有任何帮助,我们将不胜感激。
想通了,使用 VerticalSnapPointsType="Mandatory" 属性 代替 ScrollViewer。
我正在尝试让 ScrollView 进行逻辑滚动而不是物理滚动。在网上阅读了如何执行此操作后,大多数消息来源都说将 CanContentScroll 属性 设置为 False。但是,当尝试这样做时,ScrollViewer 似乎没有这个 属性。
这是我的 XAML 代码:
<ScrollViewer x:Name="TestScroll" CanContentScroll="True" HorizontalScrollBarVisibility="Disabled" HorizontalScrollMode="Disabled" Margin="66,215,1020,10" Grid.Row="1">
<StackPanel x:Name="TestPanel" Orientation="Vertical">
</StackPanel>
</ScrollViewer>
抛出的错误:
Error 1 The member "CanContentScroll" is not recognized or is not accessible.
Error 2 The property 'CanContentScroll' was not found in type 'ScrollViewer'
我正在为 Windows 8.1 开发,创建一个通用应用程序。我觉得我缺少一些参考或一些非常简单的东西,因为我看过的其他地方,它都有效。
如有任何帮助,我们将不胜感激。
想通了,使用 VerticalSnapPointsType="Mandatory" 属性 代替 ScrollViewer。