提交 c95b4dc9 authored 作者: jungleiOS's avatar jungleiOS

android 关闭自动旋转

上级 ae5fd616
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
return [super application:application didFinishLaunchingWithOptions:launchOptions]; return [super application:application didFinishLaunchingWithOptions:launchOptions];
} }
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { //- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
//
return UIInterfaceOrientationMaskAll; // return UIInterfaceOrientationMaskAll;
} //}
@end @end
...@@ -420,26 +420,14 @@ class GZVideoPlayerState extends State<GZVideoPlayer> ...@@ -420,26 +420,14 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
if (Platform.isIOS) { if (Platform.isIOS) {
GzOrientation.forceOrientation(DeviceOrientation.portraitUp); GzOrientation.forceOrientation(DeviceOrientation.portraitUp);
} else { } else {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
});
} }
} else { } else {
if (Platform.isIOS) { if (Platform.isIOS) {
GzOrientation.forceOrientation(DeviceOrientation.landscapeRight); GzOrientation.forceOrientation(DeviceOrientation.landscapeRight);
} }
else { else {
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]).then((_){ SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
});
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论