如何更改 Flutter 中 CupertinoNavigationBar 后退按钮的颜色
How to change the color of the back button in a CupertinoNavigationBar in Flutter
我想在我的 flutter 应用程序中更改后退按钮的颜色。
这是我目前拥有的:Screenshoot
我想将颜色从浅蓝色更改为白色。我在网上搜索过,但一无所获。这是我的代码(注意我的按钮是自动创建的)
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
heroTag: 'menupage',
transitionBetweenRoutes: false,
middle: Text(
'Menu Page',
style: kSendButtonTextStyle,
),
),
非常感谢!
示例
actionsForegroundColor: Colors.white
在 CupertinoNavigationBar
去做
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(actionsForegroundColor: Colors.white,
heroTag: 'menupage',
transitionBetweenRoutes: false,
middle: Text(
'Menu Page',
style: TextStyle(),
),
), child: Text(''),
);
我解决了设置 CupertinoTextThemeData...
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoApp(
theme: CupertinoThemeData(
primaryColor:
Colors.white, //change color of the BOTTOM navbar icons when selected
textTheme: CupertinoTextThemeData(
primaryColor:
Colors.white, //change color of the TOP navbar icon
感谢 Lucas 为我指明了正确的方向
我想在我的 flutter 应用程序中更改后退按钮的颜色。
这是我目前拥有的:Screenshoot
我想将颜色从浅蓝色更改为白色。我在网上搜索过,但一无所获。这是我的代码(注意我的按钮是自动创建的)
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
heroTag: 'menupage',
transitionBetweenRoutes: false,
middle: Text(
'Menu Page',
style: kSendButtonTextStyle,
),
),
非常感谢!
示例
actionsForegroundColor: Colors.white
在 CupertinoNavigationBar
去做
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(actionsForegroundColor: Colors.white,
heroTag: 'menupage',
transitionBetweenRoutes: false,
middle: Text(
'Menu Page',
style: TextStyle(),
),
), child: Text(''),
);
我解决了设置 CupertinoTextThemeData...
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoApp(
theme: CupertinoThemeData(
primaryColor:
Colors.white, //change color of the BOTTOM navbar icons when selected
textTheme: CupertinoTextThemeData(
primaryColor:
Colors.white, //change color of the TOP navbar icon
感谢 Lucas 为我指明了正确的方向