你可以在TextField
中的InputDecoration
中使用floatingLabelStyle
示例:
TextField(
decoration: InputDecoration(
floatingLabelStyle: TextStyle(
color: Colors.red,
fontSize: 12
),
labelText: 'Demo Text',
labelStyle: TextStyle(
fontSize: 16
)
),
),