[英]Flutter : How to set background color for BouncingScrollPhysics?
当我为SingleChildScrollView
设置BouncingScrollPhysics
时,背景在反弹时看起来是white
的。 有没有办法将其更改为自定义 colors?
您将需要更改在其上呈现 SingleChildScrollView 小部件的小部件的背景颜色。 如果您的 SingleChildScrollView 直接位于 Scaffold 下,则将 Scaffold 的backgroundColor
属性设置为您想要的颜色。
我这样解决了
Scaffold(
backgroundColor: Colours.background,
body: SingleChildScrollView(
child: Container(
color: Colors.white,
child: Column(
children: [
....
],
),
),
physics: BouncingScrollPhysics(),
));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.