在此記錄項(xiàng)目中所遇到問題及解決方案
把屏幕固定為豎屏
Future main() async {
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
runApp(new MyApp());
}
如果想固定插件所產(chǎn)生的頁面,需要在原生項(xiàng)目里配置
比如Android,在 [project_root]\android\app\src\main\AndroidManifest.xml 文件里配置
這個(gè)我使用第三方裁剪圖片庫的Activity
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait" //在這里配置
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>