我怎么知道旋转锁是打开还是关闭

本文关键字:旋转 我怎么知道 | 更新日期: 2023-09-27 18:20:56

我只需要知道是否有办法在windows phone 8中获得旋转锁定状态,例如

if(rotationLock == ON)do stuff;

我怎么知道旋转锁是打开还是关闭

不幸的是,没有任何方法或方式可以知道旋转锁定是开/关的,但您可以在Xaml中设置SupportedOrientationsOrientation,或者您可以在CS中将Orientation管理为:

protected override void OnOrientationChanged(OrientationChangedEventArgs e)
{
    if (e.Orientation == PageOrientation.LandscapeLeft)
        base.OnOrientationChanged(e);
}