找不到 ScrollViewer CanContentScroll 属性(Windows 8.1 通用应用程序) [英] ScrollViewer CanContentScroll Property not Found (Windows 8.1 Universal App)

查看:37
本文介绍了找不到 ScrollViewer CanContentScroll 属性(Windows 8.1 通用应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让 ScrollView 进行逻辑滚动而不是物理滚动.在在线阅读有关如何执行此操作的信息后,大多数消息来源都说要将 CanContentScroll 属性设置为 False.但是,在尝试执行此操作时,似乎 ScrollViewer 没有此属性.

I'm trying to get a ScrollView to logical scroll instead of physically. After reading up online on how to do this, most sources say to set the CanContentScroll property to False. However, when attempting to do this, it seems that ScrollViewer doesn't have this property.

这是我的 XAML 代码:

Here is my XAML code:

<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.

错误 2 在类型ScrollViewer"中找不到属性CanContentScroll"

我正在为 Windows 8.1 开发,创建一个通用应用程序.我觉得我错过了一些参考资料或一些非常简单的东西,因为我看过的其他任何地方,它都有效.

I am developing for Windows 8.1, creating a universal app. I feel like I'm missing something like a reference or something incredibly simple because everywhere else that I have looked, it just works.

任何帮助将不胜感激.

推荐答案

想通了,改为使用 ScrollViewer 的 VerticalSnapPointsType="Mandatory" 属性.

Figured it out, using the VerticalSnapPointsType="Mandatory" property for ScrollViewer instead.

这篇关于找不到 ScrollViewer CanContentScroll 属性(Windows 8.1 通用应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆