ionic2:如何在应用程序其他页面中更改单个页面横向的方向?

ionic2:如何在应用程序其他页面中更改单个页面横向的方向?,ionic2,orientation,Ionic2,Orientation,在我的应用程序中,有一个页面需要在横向显示,其他页面需要在纵向显示,我使用插件 当我在手机上运行并抛出一些异常时没有效果 "Error: Uncaught (in promise): NotSupportedError: screen.orientation.lock() is not available on this device. 我该怎么办?非常感谢您的帮助。试试这个。 this.platform.ready()。然后(()=>{ 这个.screenOrientation.unlock

在我的应用程序中,有一个页面需要在横向显示,其他页面需要在纵向显示,我使用插件

当我在手机上运行并抛出一些异常时没有效果

"Error: Uncaught (in promise): NotSupportedError: screen.orientation.lock() is not available on this device.
我该怎么办?非常感谢您的帮助。

试试这个。
this.platform.ready()。然后(()=>{
这个.screenOrientation.unlock();
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
});

试试这个。
this.platform.ready()。然后(()=>{
这个.screenOrientation.unlock();
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
});

"Error: Uncaught (in promise): NotSupportedError: screen.orientation.lock() is not available on this device.