flutter - Flutter 中 Cupertino Picker 的样式
问题描述
我曾尝试使用颤振来实现这样的布局。
为此,我使用了 Cupertino Picker Class。但它看起来并没有我想要的那么好。
我试图通过使用颤振网站上列出的属性来修复它,但我没有找到更好的解决方案。我该如何解决这个问题,或者在这种情况下是否还有另一个更好的小部件?
我的代码如下所示:
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
backgroundColor: Colors.red,
),
child: Container(
child: Center(
child: CupertinoPicker(
itemExtent: 40,
diameterRatio: 5,
offAxisFraction: 10,
backgroundColor: Colors.black54,
onSelectedItemChanged: (int index) {
print(index);
},
children: <Widget>[
Text('Tap', style: TextStyle(color:Colors.white)),
Text('Colorbattle',style: TextStyle(color:Colors.white)),
Text('Patience',style: TextStyle(color:Colors.white)),
],
))));
} }
解决方案
推荐阅读
- javascript - 使用 Google-Apps-Script 上的预定义组形成集群
- qt - 如何使用 Qt Designer 为 PushButton 设置透明背景?
- swift - 打开 CameraController (BarCodeScanner) 时 TabbarController 不隐藏
- python-3.x - Python Flask - 使用蓝图处理错误
- reactjs - 如何在页脚上使用反应路由器
- reactjs - 当我重新启动应用程序时,本地存储从浏览器中清除
- xcode - Xcode 11.2 缺少模拟器
- c# - 我可以得到我刚刚插入的数据的ID吗?
- ios - 如何快速测试闭包
- c# - 使用 RFC_READ_TABLE 读取 TCURR 表会截断速率值