在 Flutter 中,您可以在AppBar小部件中使用shape属性自定义形状,但SliverAppBar小部件中缺少此属性
AppBar(
title: Text('Hello'),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30),
),
),
),
Run Code Online (Sandbox Code Playgroud)
如何在SliverAppBar 中有圆角?
在我的应用程序清单中,我添加了android:configChanges以防止在旋转时重新加载/重新启动活动
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden|screenSize" >
Run Code Online (Sandbox Code Playgroud)
它工作,但supportActionBar(我正在使用AppCompat)保持他的高度与小字体.
ActionBar应该在纵向上更大,在横向上更小,但它保持初始值:
删除android:configChanges ="orientation | keyboardHidden | screenSize"是我找到的唯一解决方案,但应用程序重新启动旋转,我需要保留应用程序内容