welcome to Qijie's Blog 薛其杰

I had this problem as well as I wanted to constrain my game to only landscape mode. I put this in my OnLaunched handler for App.xaml:

Windows.Graphics.Display.DisplayProperties.AutoRotationPreferences=Windows.Graphics.Display.DisplayOrientations.Landscape;

However I noted that in the simulator it seemed to ignore this whereas on the hardware tablet I tested on it seemed to behave appropriately. The AutoRotationPreferences are bit flags so you can or together all the orientations you want to allow.

 

from : http://stackoverflow.com/questions/12614508/how-to-limit-orientation-in-metro-apps

posted on 2013-09-24 16:04  零点零一  阅读(259)  评论(0编辑  收藏  举报