我是Flutter的新手,我在Google上搜索了此问题,但没有找到适合我的答案。
My code is shown as below, the status bar color works well, it is white now. But the status bar text color on Android is also white, seems like the Brightness.dark
not working at all...
您的回答将不胜感激,谢谢! <3
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark.copyWith(
statusBarColor: Colors.white, // Color for Android
statusBarBrightness: Brightness.dark // Dark == white status bar -- for IOS.
));
return Scaffold(
body: Container(
...
}
According to the SystemUiOverLayStyle API docs, the text color of status bar on Android cannot be changed by
statusBarBrightness
which is only honored in iOS.希望这可以帮助!干杯