我制作了一个有多行和多列的非常宽的网格,并用按钮填充网格(没有垂直滚动)。所有这些都包含在一个全景项目中。大约水平滚动时需要3个屏幕宽度来覆盖整个网格(大约1500像素宽)。
所以问题是当用户在全景图中点击屏幕时-它从全景项的开始一直跳到全景项的结尾。因此,实际上只有网格的最左边和最右边对用户可用(只有当他非常慢地滚动时,他才能看到中间的其余内容)。
理想情况下,我应该有三个全景项目,内容重叠在所有项目上-这样内容就可以通过两次轻拍来查看-但我不能做到这一点。是否可以将网格重叠到3个全景项目上?或者,有没有可能以某种方式在中间添加某种停靠点,或者分割我当前拥有的一个全景项目,以便屏幕在中间的某个位置停止?
我找不到超过两个屏幕的示例,而且包装对我不起作用--我想要一个固定的高度,但我不能让按钮的宽度变小。不管怎么说,我甚至不知道有没有可能做到这一切?也许我过度使用了全景功能。
谢谢
编辑:
这将是我的问题的一个例子(我有超过100个按钮,所以xaml代码非常大,但这也是我试图解决的基本问题):
<controls:PanoramaItem Header="first item" Orientation="Horizontal">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="500" />
<ColumnDefinition Width="500" />
<ColumnDefinition Width="500" />
</Grid.ColumnDefinitions>
<Button Grid.Row="0"
Grid.Column="0"
Width="250"
Height="250"
Content="Button1" />
<Button Grid.Row="0"
Grid.Column="1"
Width="250"
Height="250"
Content="Button2" />
<Button Grid.Row="0"
Grid.Column="2"
Width="250"
Height="250"
Content="Button3" />
</Grid>
</controls:PanoramaItem>所以如果你把它放到你的全景控件中-你会得到一个非常宽的全景项目-如果你在Button1上点击它,它会一直跳到Button3上的最右边-所以它会让你滚动过Button2……我想让它停止在Button2上滚动。
发布于 2012-03-29 14:04:29
好吧,我在这个问题上做了研究,答案是我真的过度使用了全景项目的功能。
所以,如果你想实现我想要达到的效果--那就是让一个全景项目延伸超过3个屏幕宽度--最好的方法是创建3个独立的全景项目,并尝试手动设置每个项目的边距,这样用户就像是在浏览同一个全景项目(从一个无缝切换到另一个)。
换句话说,一个全景项目被优化为最大2个屏幕宽度,这将是我的答案。任何超过2个屏幕的内容都会丢失轻击手势行为,因此会丢失中间的内容。
发布于 2012-03-20 01:20:24
您可能想要研究将PanoramaItem的方向属性设置为水平,这应该会产生您正在寻找的效果:-
<controls:PanoramaItem Header="first item" Orientation="Horizontal">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button Grid.Row="0"
Grid.Column="0"
Width="250"
Height="250"
Content="Button1" />
<Button Grid.Row="0"
Grid.Column="1"
Width="250"
Height="250"
Content="Button2" />
<Button Grid.Row="0"
Grid.Column="2"
Width="250"
Height="250"
Content="Button3" />
</Grid>
</controls:PanoramaItem>希望这能有所帮助。
保罗·迪森
https://stackoverflow.com/questions/9766577
复制相似问题