我有一个TextField这样的,输入文本和提示文本的大小不同。
TextField(
style: Theme.of(context).textTheme.subhead.copyWith(
fontSize: 70.0,
),
decoration: InputDecoration(
hintText: 'Enter a number',
hideDivider: true,
hintStyle: TextStyle(
color: Colors.grey[500],
fontSize: 25.0,
),
),
);
Run Code Online (Sandbox Code Playgroud)
虽然用户输入文本在我的父容器中居中,但提示文本不是(顶部比底部有更多空间)。有没有办法垂直居中提示文本?
提示文本与输入文本大小不同的原因是它比绿色容器占用更多空间,因此看起来像Enter a nu...,这不是很用户友好。(或者,有没有办法在hintText中有换行符?)