window7,Window Phone 7 设备的方向

先看看WP的默认创建页面:
imagewindow7,Window Phone 7 设备的方向
WP7默认创建一个横向或者竖式的显示页面。关于页面的显示有两个属性:
SupportedOrientations="Portrait" Orientation="Portrait" (竖式)
具体看看:
SupportedOrientations有三个可选项
  • Portrait (the default)
  • Landscape
  • PortraitOrLandscape
Orientation
  • Landscape
  • LandscapeLeft (tip the phone left)
  • LandscapeRight (tip the phone right)
  • Portrait
  • PortraitDown (normal vertical position)
  • PortraitUp (tip the phone upside-down)
同时WP还提供了一个事件:OrientationChanged 来监视设备方向的改变。
从上面的信息不难得出:要使页面适应设备的方向,可以设置SupportedOrientation为PortraitOrLandscape,在OrientationChanged事件设置Orientation来调整显示效果:如图
imageimagewindow7,Window Phone 7 设备的方向 imageimageimagewindow7,Window Phone 7 设备的方向
代码:
imageimageimagewindow7,Window Phone 7 设备的方向imageimageimagewindow7,Window Phone 7 设备的方向代码

最新评论

发表评论