美文网首页
横竖屏设置

横竖屏设置

作者: 代码小王子 | 来源:发表于2020-10-13 09:39 被阅读0次
  // 强制竖屏
  runApp(MyApp());
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
    DeviceOrientation.portraitDown
  ]);
}
void main() {
  // 强制横屏
  runApp(MyApp());
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.landscapeLeft,
    DeviceOrientation.landscapeRight
  ]);
}

相关文章

网友评论

      本文标题:横竖屏设置

      本文链接:https://www.haomeiwen.com/subject/hgnmpktx.html