iPhone 11的底部导航栏有底部阴影,如上图所示,有什么方法可以去除阴影吗?
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: BottomAppBar(
clipBehavior: Clip.antiAliasWithSaveLayer,
shape: CircularNotchedRectangle(),
child: Theme(
data: Theme.of(buildContext)
.copyWith(canvasColor: Colors.white, primaryColor: Colors.grey),
child: BottomNavigationBar(
onTap: (index){
},
type: BottomNavigationBarType.fixed,
items: bottomNavigationBar.map((element) {
return BottomNavigationBarItem(
icon: Icon(element["icon"]), title: Text(element["title"]));
}).toList(),
),
),
));
Run Code Online (Sandbox Code Playgroud)
编辑:这是我设置海拔后得到的结果:0
编辑:添加安全区域bottomAppBar阴影问题解决后,但是否可以保留我之前的statusBarColor(凹口区域)?
小智 7
在您的 BottomNavigationBar 中放置elevation: 0.0
示例:
child: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
backgroundColor: Theme.of(context).primaryColor,
elevation: 0.0,
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11307 次 |
| 最近记录: |