【发布时间】:2020-07-29 00:06:42
【问题描述】:
我想让 BottomNavigationBar 的阴影更暗更明显。我通常通过添加边框来做到这一点,但我现在不能这样做。感谢您的帮助!
【问题讨论】:
-
请分享您的代码,让我们知道您到目前为止所做的尝试
标签: flutter
我想让 BottomNavigationBar 的阴影更暗更明显。我通常通过添加边框来做到这一点,但我现在不能这样做。感谢您的帮助!
【问题讨论】:
标签: flutter
这是给BottomNavigationBar添加边框的方法
() => showModalBottomSheet(
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
side: BorderSide(color: Colors.black, width: 2.0),
),
builder: (context) => Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.black,
blurRadius: 20.0, // has the effect of softening the shadow
spreadRadius: 5.0, // has the effect of extending the shadow
offset: Offset(
10.0, // horizontal, move right 10
10.0, // vertical, move down 10
),
)
],
),
),
),
还可以看看 box shadow 这可能有你想要的效果
【讨论】: