在 Flutter 中使用半透明灰色填充呈现的 RaisedButton
RaisedButton rendered with a semi-transparent gray fill in Flutter
我在 Column 中有一个 RaisedButton,它在 Stack 中
Stack(
children: [
PageView(
children: [...],
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
children: [
RaisedButton(
color: Colors.teal,
child: Text("Button"),
),
...
),
...
但是,按钮不是用蓝绿色填充呈现的,而是灰色和半透明的。
Here it is on top of an orange Container.
有什么办法可以让这个按钮变成青色吗?
如果没有为 RaisedButton 提供 onPressed,它将显示为 garyed 或 disabled。
您可以通过为 disabledColor
提供值来设置为禁用的 RaisedButton 显示的颜色
有关详细信息,请访问此 link
我在 Column 中有一个 RaisedButton,它在 Stack 中
Stack(
children: [
PageView(
children: [...],
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
children: [
RaisedButton(
color: Colors.teal,
child: Text("Button"),
),
...
),
...
但是,按钮不是用蓝绿色填充呈现的,而是灰色和半透明的。 Here it is on top of an orange Container.
有什么办法可以让这个按钮变成青色吗?
如果没有为 RaisedButton 提供 onPressed,它将显示为 garyed 或 disabled。
您可以通过为 disabledColor
提供值来设置为禁用的 RaisedButton 显示的颜色有关详细信息,请访问此 link