【问题标题】:(UWP) ScrollViewer PanningMode - does it exist?(UWP) ScrollViewer PanningMode - 它存在吗?
【发布时间】:2016-01-20 17:41:02
【问题描述】:

我真的希望我在这里没有做一些愚蠢的事情,但我正在尝试制作一个(快速?)UWP Windows 10 测试应用程序,其中包括一个 ScrollViewer 来进行图像滚动。 ScrollViewer 工作正常,直到我尝试使用 PanningMode,它只是说它不存在。我看到另一篇 PanningMode="Both" 不起作用的帖子,但这丝毫没有帮助,没有解决我遇到的问题。是我很愚蠢,比如 PanningMode 由于某种原因不存在,还是有什么不对劲?这是我的 MainPage.xaml(虽然目前没有优化或按照任何实际标准制作),我希望它已经足够了。

<Page
x:Class="NewLunderground.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:NewLunderground"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <ScrollViewer x:Name="ScrollusViewus" HorizontalAlignment="Left" VerticalAlignment="Top" ZoomMode="Enabled" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Visible" PanningMode="Both"  Height="Auto" Width="Auto">
        <Image x:Name="mapImage" HorizontalAlignment="Left" VerticalAlignment="Top" Source="Assets/map.png" Stretch="None" ManipulationMode="All" ScrollViewer.HorizontalScrollBarVisibility="Visible" Width="Auto" Height="Auto"/>
    </ScrollViewer>

</Grid>

【问题讨论】:

    标签: uwp scrollviewer windows-10-universal


    【解决方案1】:

    PanningMode 属性在 WPF 应用程序中指定 ScrollViewer 应如何响应触摸操作。您可以确定它是水平滚动、垂直滚动还是两者都滚动。然而,这在 UWP 应用程序中不是必需的,其中 ScrollViewer 会自动对触摸操作做出反应。这就是为什么该属性不存在并且您收到错误的原因。

    【讨论】:

    • 这很奇怪,我似乎无法通过手机触摸滚动它。没关系。这可能与我如何让卷轴工作有关。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2012-03-17
    • 2018-09-17
    • 1970-01-01
    • 2017-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-09
    相关资源
    最近更新 更多