ScrollViewer中的图像,完全可见&可缩放的?

时间:2014-01-19 20:13:08

标签: winrt-xaml windows-8.1

我有一个Win 8.1应用程序,它显示一个我想允许捏合/缩放的图像,实现这个我把控制放在一个。

根据图像的大小(通常是分辨率小于可用尺寸的小图像),工作正常,但对于较大的图像,它坚持(视觉上)切断底部并需要手动向下滚动到看到它。

解决这个问题的唯一方法是设置VerticalScrollBarVisibility& Horizo​​ntalScrollBarVisibility to Disabled ...它带有它自己的问题。设置后,我可以捏缩放,但它会快速(并自动)将视图捕捉回左上角。

    <ScrollViewer Grid.Row="0"
                  Grid.Column="0"
                         VerticalScrollBarVisibility="Disabled"
                         HorizontalScrollBarVisibility="Disabled"
                  MinZoomFactor=".25"
                  MaxZoomFactor="10" >
        <Image Source="ms-appx:///Assets/Big Test Image.jpg" />
    </ScrollViewer>

有关我需要在此处或其他地方进行调整以强制图像开始完全显示的任何建议,并且仍然是可缩放的&amp;可聚焦?

1 个答案:

答案 0 :(得分:1)

尝试将以下属性添加到ScrollViewer标记:

HorizontalSnapPointsType="None" VerticalSnapPointsType="None" ZoomSnapPointsType="None"
IsHorizontalRailEnabled="False" IsVerticalRailEnabled="False" ManipulationMode="All"
相关问题