我想知道有没有什么办法可以给 iPhone X SafeArea 添加两种不同的颜色?
React Native
这可以通过添加两个来解决SafeAreaView
。有谁知道如何在颤振上解决这个问题?
谢谢
@override
Widget build(BuildContext context) {
return Container(
color: Colors.blue,
child: SafeArea(
left: true,
top: true,
right: true,
bottom: true,
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.display1,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
),
),
),
);
}