有什么方法可以使方向仅限于抖动中的肖像或风景吗?谢谢。
最好的方法是SystemChrome
在您的主要方法中使用。例如:
要将方向锁定为横向,请使用:
await SystemChrome.setPreferredOrientations(
[DeviceOrientation.landscapeRight, DeviceOrientation.landscapeLeft]
);
要将方向锁定为纵向,请使用:
await SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitRight, DeviceOrientation.portraitLeft]
);
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句