gpt4 book ai didi

flutter - 我想使底部的NavBar透明

转载 作者:行者123 更新时间:2023-12-03 04:52:34 39 4
gpt4 key购买 nike

我想使我的底部导航栏透明,我尝试了使用color属性的不透明度,但是它不起作用。只是为了让您在附加屏幕截图时有了一个更好的了解

请忽略导航栏上的按钮,我只想透明,下面是我的代码

return Scaffold(
body: Column(
.......
bottomNavigationBar: Container(
color: Colors.white,
padding: EdgeInsets.all(20),
child: Text(
'SUIVANT',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Karla', fontSize: 20, fontWeight: FontWeight.bold),
),
),
);

任何帮助将不胜感激。提前thnx。

最佳答案

最终,经过大量的思考并运用了奇怪的方式,我能够以一种截然不同的方式来做到这一点。我必须完成BottomNavigationBar:属性,因为它不允许被修改。我必须将主列包装在Stack()小部件中

return Scaffold(
body: Stack(
children: <Widget>[
Column(
children: <Widget>[
//.......
/*this is the Container() I had to add in stack after finishing the bottomnavbar*/
Container(
height: MediaQuery.of(context).size.height,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(),
Container(
color: Colors.white.withOpacity(0.9),
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(20),
child: Text(
'SUIVANT',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Karla',
fontSize: 20,
fontWeight: FontWeight.bold),
),
),
],
),
),
],
),
],
),
);

我不知道这是一个不好的方法还是正确的方法,但是经过大量的思考过程,我找不到其他解决方案。如果有错误,请随时根据波动规则进行修改。感谢大家的贡献。

This is how the result looks

关于flutter - 我想使底部的NavBar透明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61141245/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com