Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 7 应用程序如何仅支持;“景观左”;windows phone 7中的源代码?_Windows Phone 7 - Fatal编程技术网

Windows phone 7 应用程序如何仅支持;“景观左”;windows phone 7中的源代码?

Windows phone 7 应用程序如何仅支持;“景观左”;windows phone 7中的源代码?,windows-phone-7,Windows Phone 7,我写了一份申请书。我需要它只支持LandscapeLeft方向。我的xaml如下所示: SupportedOrientations="Landscape" Orientation="LandscapeLeft" 但是,当我将手机转到LandscapeRight时,页面会自动切换。我已经重写了OnOrientationChanged函数,但它不起作用 如何使其工作?不建议仅支持横向,但如果需要,您的覆盖方法应类似于此: protected override void OnOrientation

我写了一份申请书。我需要它只支持
LandscapeLeft
方向。我的xaml如下所示:

SupportedOrientations="Landscape" 
Orientation="LandscapeLeft"
但是,当我将手机转到
LandscapeRight
时,页面会自动切换。我已经重写了
OnOrientationChanged
函数,但它不起作用


如何使其工作?

不建议仅支持横向,但如果需要,您的覆盖方法应类似于此:

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

在OnOrientationChanged中是否将e.Handle设置为true?e是否处理了成员名称?