flutter_boost icon indicating copy to clipboard operation
flutter_boost copied to clipboard

flutter_boost在iOS端如何强制页面横屏?

Open amazingrace opened this issue 6 years ago • 2 comments

flutter_boost如何强制页面横屏?

在Native端以下代码无作用: NSNumber *orientationTarget = [NSNumber numberWithInt:interfaceOrientation]; [[UIDevice currentDevice] setValue:orientationTarget forKey:@"orientation"];

在Dart端以下代码无作用: SystemChrome.setPreferredOrientations([ DeviceOrientation.landscapeRight ]);

amazingrace avatar Jan 17 '20 06:01 amazingrace

iOS强制横屏不是依赖于单个ViewController,需要在AppDelegate中设置。您的问题其实不是flutterboost的问题

xujim avatar Feb 26 '20 07:02 xujim

给你个详细例子:https://github.com/alibaba/flutter_boost/blob/master/Frequently%20Asked%20Question.md

xujim avatar Feb 26 '20 07:02 xujim