屏幕方向(Orientation)
屏幕方向感应页面(Orientation-Aware Pages)
竖屏(Portrait,也叫纵向或垂直模式)与横屏(Landscape,也叫横向或水平模式)
屏幕方向感应
在visual studio可以新增竖屏和横屏的页面
页面可以支持竖屏,横屏或同时支持2者
PhoneApplicationPage.SupportedOrientaionsProperty支持Portrait,Landscape和PortraitOrLandscape
如果页面支持PortraitOrLandscape,当用户翻转电话的时候页面会自动改变屏幕方向
不能通过代码来改变屏幕方向
可以强制页面只支持横飞和竖屏
重写OrientationChanged
如果支持方向为PortraitOrLandscape系统会自动翻屏
但是如果需要重新布局,需要重写OrientationChanged
常用控件
Canvas
Grid
StackPanel
TextBlock
Image
MediaElement