【问题标题】:WIndows Phone 7 : Image does not rotate in landscape modeWIndows Phone 7:图像在横向模式下不旋转
【发布时间】:2012-05-22 15:34:10
【问题描述】:

我将覆盖OnOrientationChanged,如下所示

 protected override void OnOrientationChanged(OrientationChangedEventArgs e)  
 {  
     Grid.SetRow(hyperlinkButton1, 0);
     Grid.SetRow(hyperlinkButton2, 1);
 } 

现在有了这个,我可以在纵向模式下垂直堆叠网格。并以垂直模式水平堆叠。

但是里面的孩子没有旋转。在横向模式下,它们看不到直立,而是与纵向模式对齐。

如何旋转单个子项[图像、网格等] 以使它们在横向模式下也直立。

【问题讨论】:

  • 你有完整的复制品吗?子控件应该旋转,除非您使用弹出窗口(在正确支持方向更改方面存在一些问题)。

标签: windows-phone-7 rotation image-rotation landscape-portrait


【解决方案1】:

如果您只想在方向改变时旋转页面上的特定控件 - 这无法自动完成。您只能将 RotateTransform 放入 XAML 并绑定到它。当方向改变时,这个 RotateTransform 可以被代码修改。

另一方面,如果您谈论的是旋转整个页面,那么您需要将 SupportedOrientations=”PortraitOrLandscape” 添加到页面元素。

希望这会有所帮助。

【讨论】:

    【解决方案2】:

    在您的 xaml 页面上更改 SupportedOrientations=”PortraitOrLandscape”。

    【讨论】:

      猜你喜欢
      • 2012-11-10
      • 2011-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多