首页 > 其他 > 详细

Flutter控制屏幕旋转

时间:2019-10-07 12:40:24      阅读:532      评论:0      收藏:0      [点我收藏+]
/// 初始化时设置为只能竖屏
@override void initState() { SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown ]); super.initState(); }
/// 退出时还原四个方向
dispose(){ SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight, ]);
super.dispose(); }

 

Flutter控制屏幕旋转

原文:https://www.cnblogs.com/hepeng/p/11629762.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!