如何正确滚动水平全景项目?

时间:2013-07-05 04:50:02

标签: c# windows-phone-7 xaml windows-phone-8

我有一个全景应用程序,其中一个项目是水平的,但当我向左或向右滚动时,一半项目出现在左侧或右侧而不会出现在屏幕中间:如第三个瓦在这里

enter image description here

<phone:PanoramaItem Header="third item" Orientation="Horizontal">

</phone:PanoramaItem>

我希望在三个阶段中查看该项目,以使其所有内容在中间显示一次。 我怎样才能做到这一点?感谢

1 个答案:

答案 0 :(得分:2)

在Windows Phone Panorama App示例中,“tiles”的大小为173x173。如果您将尺寸调整为140x140,您将能够看到整个正方形

<phone:PanoramaItem Header="third item" Orientation="Horizontal">
    <!--Double wide Panorama with large image placeholders-->
    <Grid>
        <StackPanel Margin="0,4,16,0" Orientation="Vertical" VerticalAlignment="Top">
            <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
                <Border Background="#FFFFC700" Height="140" Width="140" Margin="12,0,0,0"/>
                <Border Background="#FFFFC700" Height="140" Width="140" Margin="12,0,0,0"/>
                <Border Background="#FFFFC700" Height="140" Width="140" Margin="12,0,0,0"/>
                <Border Background="#FFFFC700" Height="140" Width="140" Margin="12,0,0,0"/>
            </StackPanel>
            <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="0,12,0,0">
                <Border Background="#FFFFC700" Height="140" Width="140" Margin="12,0,0,0"/>
                <Border Background="#FFFFC700" Height="140" Width="140" Margin="12,0,0,0"/>
                <Border Background="#FFFFC700" Height="140" Width="140" Margin="12,0,0,0"/>
                <Border Background="#FFFFC700" Height="140" Width="140" Margin="12,0,0,0"/>
            </StackPanel>
        </StackPanel>
    </Grid>
</phone:PanoramaItem>