【发布时间】:2011-12-12 14:53:31
【问题描述】:
当手机处于纵向位置时,纵向和横向方向的图片更适合屏幕。当手机处于横向位置时,纵向方向的图片不适合屏幕,用户必须滚动它们才能看到完整的图片。
例如,我的屏幕处于纵向位置,横向位置 w/h = 447/ 585 和 585/ 447。在手机的纵向位置,我的纵向方向的图片适合大小 447/ 585,但在横向位置,同一张图片的宽度和高度变为 585,与可能的最大值成比例增长,比如说 800p
我知道这是因为 ScrollViewer 和 Auto size,但我想保留它,因为我有一些要滚动的文本。
当手机处于纵向位置时,如何限制图像高度。
我的代码:
<ScrollViewer x:Name="ContentGrid" Grid.Row="1" >
<controls:Pivot x:Name="pivot1" Title="New pictures" SelectionChanged="SelectionChangedEventHandler">
<controls:PivotItem>
<StackPanel>
<Image Height="Auto" Width="Auto" HorizontalAlignment="Center" Margin="9,6,0,0" Name="image1" Stretch="UniformToFill" VerticalAlignment="Center" />
</StackPanel>
</controls:PivotItem>
</controls:Pivo
</ScrollViewer>
有什么建议吗? 找到了下一个问题,但没有任何用处
Scrollbar Size in ScrollViewer
Silveright ScrollViewer with Image and ScaleTransform
https://stackoverflow.com/questions/6938658/size-grid-in-combination-with-scrollviewer
【问题讨论】:
-
你能添加你想要实现的模型吗?
标签: silverlight image windows-phone-7 scrollview