flutter - 如何在不影响后台内容的情况下弯曲底部导航栏角?扑
问题描述
我创建了一个带有颤振的自定义底部导航栏。但我仍然可以看到白色填充了弯角后面的背景。我想看看背景内容。
这就是底部导航栏的样子。
如您所见,角落充满了白色。
这是我的底部导航栏代码。
bottomNavigationBar: Container(
decoration: BoxDecoration(
color: Colors.transparent,
backgroundBlendMode: BlendMode.clear,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(18),
topRight: Radius.circular(18),
),
boxShadow: [
BoxShadow(color: Colors.black38, spreadRadius: 0, blurRadius: 10),
],
),
height: MediaQuery.of(context).size.height * 0.085,
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(18.0),
topRight: Radius.circular(18.0),
),
child: BottomNavigationBar(
backgroundColor: Color(0xFFF0B50F),
type: BottomNavigationBarType.fixed,
selectedLabelStyle: TextStyle(fontSize: 12),
items: [
BottomNavigationBarItem(),
BottomNavigationBarItem(),
BottomNavigationBarItem(),
BottomNavigationBarItem(),
BottomNavigationBarItem(),
],
currentIndex: _selectedPage,
selectedItemColor: Colors.black,
onTap: _onItemTapped,
),
),
),
我尝试将容器的颜色设置为透明。但它没有用。
解决方案
试试这个:
Scaffold(
extendBody: true,
推荐阅读
- r - 参数不是数字或逻辑:返回 NA`
- camera-calibration - 找到单应矩阵和解决透视n点问题有什么区别?
- masstransit - 测试 MassTransit 状态机 saga 活动
- vbscript - 这个 VB 脚本有潜在危险吗?
- arrays - ANGULAR:通过单击按钮进行数组过滤不起作用
- java - 使用 readChar() 后 JLine 不显示字符
- function - 如何将一个函数作为参数传递给另一个函数?
- java - springboot的delete mapping方法出现405 not found错误
- python - Python TKINTER。获取返回值到 Button(command)
- javascript - Laravel如何在关闭模式时重置模式ajax数据值