[英]Removing the drop shadow from a Scaffold AppBar in Flutter?
在 Flutter 中使用 Scaffold 小部件时,有没有办法删除应用栏(AppBar 类)下的投影?
我试过一些可能对你有帮助的东西
AppBar(
backgroundColor: Colors.transparent,
bottomOpacity: 0.0,
elevation: 0.0,
),
看一下这个
如果您想在不重复代码的情况下删除所有应用栏的阴影,只需在您的应用程序主题( ThemeData
)中添加一个带有elevation: 0
的AppBarTheme
属性,在您的MaterialApp
小部件内:
// This code should be located inside your "MyApp" class, or equivalent (in main.dart by default)
return MaterialApp(
// App Theme:
theme: ThemeData(
// ••• ADD THIS: App Bar Theme: •••
appBarTheme: AppBarTheme(
elevation: 0, // This removes the shadow from all App Bars.
)
),
);
在Flutter中使用Scaffold小部件时,是否可以删除应用栏(AppBar类)下的阴影?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.