WP7 (Windows phone 7) Lock phone orientation in XAML or C#

前端 未结 3 958
南笙
南笙 2021-01-19 03:02

Is it possible to manualy lock the phone orientation in Windows phone 7 ? Because I\'m using the accelerometer to handle buttons\' rotation with a fixed UI.

I\'ve tr

3条回答
  •  忘掉有多难
    2021-01-19 03:20

    add this this.SupportedOrientations = SupportedPageOrientation.Portrait; after InitializeComponent(); in MainPage() constructor to lock the orientation in Portrait mode. It works fine for me.

提交回复
热议问题