AppBar 透明需要在Scaffold 下面
透明有两种情况
第一种 以这个为例子 这种全透明
实现思路就是
return Scaffold(
extendBodyBehindAppBar: true,//主要代码为extendBodyBehindAppBar 这个属性
appBar: AppBar(
centerTitle: true,
// 标题居中
backgroundColor: Colors.transparent,
// 背景颜色设置为透明
shadowColor: Colors.transparent,
// 阴影也要设置为透明
//把AppBar 设置为透明色
elevation: 0,
),

文章详细介绍了在Flutter中如何实现AppBar的透明效果,包括全透明和滑动时透明两种情况,主要涉及Scaffold的extendBodyBehindAppBar属性以及AppBar的配置设置。
最低0.47元/天 解锁文章
1135

被折叠的 条评论
为什么被折叠?



