windows-phone-7 - 包裹面板不会滚动

标签 windows-phone-7 windows-phone-8

我已经设置了 ScrollViewer 的高度,但它不会滚动。有 9 张图片。 Wrappanel 设置为每行显示 2 个图像。但这只显示 3 行(6 张图像)。问题出在哪里?


<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"    Height="500">

    <toolkit:WrapPanel Margin="-3,-20,12,-3" Background="White"  ItemHeight="200" Orientation="Horizontal" ItemWidth="200" Height="600" Width="480" FlowDirection="LeftToRight">

    <Image Height="160" Name="image11" Source="/ImgBadges/Badge_1.png" Stretch="UniformToFill" Width="160" />

    <Image Height="160" Name="image12" Source="/ImgBadges/Badge_2.png" Stretch="UniformToFill" Width="160" />

    <Image Height="160" Name="image13" Source="/ImgBadges/Badge_3.png" Stretch="UniformToFill" Width="160" />

    <Image Height="160" Name="image14a" Source="/ImgBadges/Badge_3.png" Stretch="UniformToFill" Width="160" />

    <Image Height="160" Name="image15b" Source="/ImgBadges/Badge_3.png" Stretch="UniformToFill" Width="160" />

    <Image Height="160" Name="image16c" Source="/ImgBadges/Badge_3.png" Stretch="UniformToFill" Width="160" />

     <Image Height="160" Name="image17d" Source="/ImgBadges/Badge_3.png" Stretch="UniformToFill" Width="160" />

     <Image Height="160" Name="image18e" Source="/ImgBadges/Badge_3.png" Stretch="UniformToFill" Width="160" />

     <Image Height="160" Name="image19f" Source="/ImgBadges/Badge_3.png" Stretch="UniformToFill" Width="160" />

    </toolkit:WrapPanel>

</ScrollViewer>

最佳答案

您已将WrapPanel的高度强制为600。将要设置的高度更改为仅在ScrollViewer上设置,以便WrapPanel code> 滚动时可以有无限的空间来添加更多项目:

<ScrollViewer Height="500" ...>
    <toolkit:WrapPanel ItemHeight="200" Orientation="Horizontal" ItemWidth="200" Width="480" FlowDirection="LeftToRight">
          ...
    </toolkit:WrapPanel>
</ScrollViewer>

摘要:移除 WrapPanel 的高度,以便可以向其添加更多项目。

关于windows-phone-7 - 包裹面板不会滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17018946/

相关文章:

c# - HttpClient 检索所有 header

c# - MediaCapture 改变相机焦点(WP8.1 和 WinRt8.1)

c# - 广告控件不显示任何内容并在 Windows Phone 应用程序上消失

wpf - 如何在 Expression Blend 中使用 CollectionViewSource 和设计时数据?

windows-phone-7 - 当 DragStartedEvent 触发时获取对象的绝对原点

c# - 读取和使用 XML 文件作为数据库 - Windows Phone 7 应用程序

c# - Windows Phone 7 Mango 启动画面上的断断续续的渐变

c# - 如何实现两种方式绑定(bind)到表示来自外部可修改数据库的数据的集合?

Windows 应用商店应用着色器模型 4_0_level_9_3 和 VPOS

windows-phone-7 - 如何从另一个 xaml- 文件获取 WP7 全景内容?