【发布时间】:2019-11-18 03:12:27
【问题描述】:
我有带有图标的 textformfield,但输入文本的位置与我的图标不相等
我该如何解决这个问题?
我试过的代码
class TestPage extends StatefulWidget {
@override
_TestPageState createState() => _TestPageState();
}
class _TestPageState extends State<TestPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
TextFormField(
decoration: InputDecoration(
prefixIcon: Icon(Icons.person),
filled: true,
hintText: 'Email',
fillColor: Colors.white
),
),
TextFormField(
decoration: InputDecoration(
prefixIcon: Icon(Icons.https),
filled: true,
hintText: 'Password',
fillColor: Colors.white
),
),
],
)
);
}
}
【问题讨论】:
-
嗨,Karin,你能展示一下你到目前为止所做的相关代码吗?
-
你好迈克尔,我为代码编辑了我的问题