flutter_boost
flutter_boost copied to clipboard
flutter_boost在iOS端如何强制页面横屏?
flutter_boost如何强制页面横屏?
在Native端以下代码无作用:
NSNumber *orientationTarget = [NSNumber numberWithInt:interfaceOrientation];
[[UIDevice currentDevice] setValue:orientationTarget forKey:@"orientation"];
在Dart端以下代码无作用:
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeRight
]);
iOS强制横屏不是依赖于单个ViewController,需要在AppDelegate中设置。您的问题其实不是flutterboost的问题
给你个详细例子:https://github.com/alibaba/flutter_boost/blob/master/Frequently%20Asked%20Question.md