반응형
질문
I'm a bit confused how to change the hint color of the textfield. Someone can guide me how to do it.Thanks
child: TextField(
style: TextStyle(fontSize: 20),
decoration: InputDecoration(
hintText: "Password",
border: new OutlineInputBorder(
borderSide: new BorderSide(
color: Colors.teal,
),
),
prefixIcon: const Icon(
Icons.security,
color: Colors.white,
),
),
),
답변
당신은 InputDecoration
에서 hintStyle
을 사용할 수 있습니다.
TextField(
style: TextStyle(fontSize: 20),
decoration: InputDecoration(
hintText: "비밀번호",
hintStyle: TextStyle(fontSize: 20.0, color: Colors.redAccent),
border: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.teal,
),
),
prefixIcon: const Icon(
Icons.security,
color: Colors.white,
),
),
),
반응형
댓글