您的位置:首页 > 移动开发

Disable Portrait in app

2013-09-24 16:04 405 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: